Re: Has MediaStream the stop() method?

On 30/12/13 12:21, Iñaki Baz Castillo wrote:
> 2013/12/30 Iñaki Baz Castillo <ibc@aliax.net>:
>> Hi, according to http://www.w3.org/TR/mediacapture-streams/ and
>> http://dev.w3.org/2011/webrtc/editor/getusermedia.html the MediaStream
>> class has no "stop" method, but the example 2 clearly shows
>> "stream.stop()".
>>
>> Is it a bug in the spec? In fact, Firefox 26 does not include the
>> stop() method in MediaStream while Chrome does.
>
> Currently FF returns a LocalMediaStream after mozGetUserMedia, which
> does implement the stop method. But AFAIK it will become a MediaStream
> in the future, am I right? If so, why does not the spec mention the
> stop method?

I think the implementation is not in line with the latest spec. There 
used to be a LocalMediaStream (which is what you got from getUserMedia). 
The LocalMediaStream had a stop() method to allow the app to revoke the 
access to microphone and camera (which is got via the getUserMedia call).

But a lot of functionality has move from the MediaStream level down to 
the MediaStreamTrack level. There is now only one type of MediaStream 
(i.e. no LocalMediaStream) and it has no stop method. Instead the 
MediaStreamTrack has a stop method, and in the latest version of the 
draft it is specced in the way that the source (microphone, camera) is 
stopped when all MediaStreamTracks that use the source have been stopped.

I can't spot the use of stop() in example 2 of 
http://dev.w3.org/2011/webrtc/editor/getusermedia.html.

Stefan

>
>


Received on Tuesday, 31 December 2013 06:59:53 UTC