Re: Releasing media stream created by gUM

On 10/18/13 11:53 AM, Kevin Dempsey wrote:
> In earlier versions of the gUM spec, the stream created by a
> getUserMedia() call had a stop() method that ended all the tracks,
> reduced the reference count on the track sources and if that reference
> count reached zero, the source was stopped (and recommended that any
> 'on-air' indicator was removed).
>
> In recent versions of the spec the stream doesn't have a stop() method,
> but MediaStreamTrack does. However, this stop() method stops the source
> regardless of whether any other track is using that source. I know that
> the 'best practices' section recommends that sources should not be
> shared but the MediaStreamTrack stop() function's "kill switch"
> behaviour forces that upon implementors.
>
> So under the current spec, the release the stream created by
> getUserMedia() you have to call stop on all tracks it has (one audio and
> one video maximum). This will also kill the sources and therefore end
> any track also using those sources.

Kevin, could you elaborate on what functionality you are missing? And 
note that stop() on a track will only stop the source for this context - 
if there is another app using the same source it will continue to work.

* Is it a way to revoke access to input devices (for this app)? I guess 
not since you can do that by stop() on the corresponding track(s).

* Is it a way to allow your app be a bit careless in its book keeping 
(stop() on a track would indeed stop the source from feeding data into 
other tracks in the same app)?

* Is it a way to tell the UA that a MediaStream is not needed any more 
(so it can be garbage collected)?



Received on Tuesday, 22 October 2013 10:59:19 UTC