Re: About onaddtrack/onremovetrack

On 5/19/15 1:38 AM, Adam Bergkvist wrote:
> Generally speaking, one reason for not firing events together with
> synchronous operations is that by the time the scheduler picks up the
> task that fires the event, the state may have changed synchronously
> again.

I'm not following. Events are synchronous, so when they happen in a 
synchronous call, should it not happen before the call returns?

That's how onclick and onfocus work: http://jsfiddle.net/zh3g52ua

>   The result is that the event doesn't reflect the correct state
> when fired. For example, an addtrack event fires with track as it's
> payload, but the track is no longer present on the MediaStream. That's
> why state updates are made synchronously by the task that fires them; so
> the event properly reflects the state it's supposed to when fired.
>
> /Adam

.: Jan-Ivar :.

Received on Wednesday, 20 May 2015 18:20:03 UTC