Monday, June 3, 2024
-4
rated 0 times [  2] [ 6]  / answers: 1 / hits: 16053  / 7 Years ago, thu, march 16, 2017, 12:00:00

My goal is to enable screen sharing in the middle of a video or audio call using webrtc web application .



Well I found that I can use MediaStreamTrack.applyConstraints() to change video property but is it possible to change the video source ? further more how can I add video to an existing audio stream .



I need this to work on chrome only for now .


More From » google-chrome

 Answers
10
localStream.stop();
peerconnection.removeStream(localStream);


I was able to find the solution by following steps




  1. remove the current stream


  2. add new stream


  3. create new offer




Note that removeStream is deprecated and no longer in the spec, and not implemented in all browsers. E.g. this won't work in Firefox. stream.stop() is also deprecated in favor of stream.getTracks().forEach(track => track.stop())


[#58527] Tuesday, March 14, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
janettejordynm

Total Points: 550
Total Questions: 94
Total Answers: 98

Location: Senegal
Member since Fri, Aug 21, 2020
4 Years ago
janettejordynm questions
Tue, Nov 24, 20, 00:00, 4 Years ago
Sat, May 23, 20, 00:00, 4 Years ago
Mon, Apr 6, 20, 00:00, 4 Years ago
Tue, Feb 18, 20, 00:00, 4 Years ago
;