Re: No way to stop sending media but still displaying it locally

On 28/01/15 23:38, Iñaki Baz Castillo wrote:
> Use case:
>
> 1) My local stream (mic&webcam) is being displayed on a <video> element.
> 2) And it is also being sent to the peer via WebRTC.
> 3) I want to "pause" my stream in the wire, but still view it in the
> <video> element.
>
>
> The only way to achieve bullet 2 (without stopping the PeerConnection
> or removing the local stream form it) is by setting "enabled=false" in
> each track of the local stream. But it also stops the local <video>
> rendering (so it does not satisfy bullet 3).
>
> So I miss something? I couldn't find any solution in the spec(s).
>
> P.S. Would stream.clone() work in this case?

I think this would be the solution now. Clone the MediaStream; attach 
one of the two clones to the video element and the other to the 
PeerConnection; put enabled=false on the track(s) in question of the 
MediaStream attached to the PC. Note, this does not really pause 
sending, but sends black frames/silence over the net.

A little bit down the road the RTCRTPSender (not yet in the main branch 
of the spec) will be there, and it will AFAIK have a method for "stop 
sending this track". Then you will not have to clone.

>


Received on Thursday, 29 January 2015 06:54:46 UTC