W3C home > Mailing lists > Public > public-webrtc@w3.org > December 2013

Re: Has MediaStream the stop() method?

From: Stefan Håkansson LK <stefan.lk.hakansson@ericsson.com>
Date: Tue, 31 Dec 2013 06:59:09 +0000
To: Iñaki Baz Castillo <ibc@aliax.net>, "public-webrtc@w3.org" <public-webrtc@w3.org>
Message-ID: <1447FA0C20ED5147A1AA0EF02890A64B1C431BE3@ESESSMB209.ericsson.se>
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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:37 UTC