Re: LocalMediaStream.stop() and MediaStream.onended

On 2012-05-31 15:45, Dominique Hazael-Massieux wrote:
> Hi,
>
> While writing a test case for LocalMediaStream.stop this morning [1], I
> discovered that when calling LocalMediaStream.stop(), the "ended" event
> is not supposed to be triggered:
>> A MediaStream object is said to be finished when all tracks belonging
>> to the stream have ended. When this happens for any reason other than
>> the stop() method being invoked, the user agent must queue a task
>
> I wonder what's the intent behind special-casing stop() here?

I believe the idea is that if you want to run code when the stream is 
stopped you can simply run that code after calling stop(). This is 
similar to EventSource.disconnect() which doesn't fire an event either. 
WebSocket.close() however, has the closing handshake which may take time 
so in that case a close event is fired when the handshake is done.

>
> Dom
>
>
> 1. http://w3c-test.org/media-capture/submitted/W3C/localstream-stop.html
>
>
>

Received on Monday, 4 June 2012 14:48:20 UTC