Re: [mediacapture-fromelement] Different behavior when onaddtrack is fired for element.captureStream (#100)

I would agree the spec can be clearer on this.

I think the question boils down to whether the events fire sync or async in the text:
> If the selected [VideoTrack](https://html.spec.whatwg.org/multipage/media.html#videotrack) or enabled [AudioTrack](https://html.spec.whatwg.org/multipage/media.html#audiotrack)s for the media element change, a [addtrack](https://w3c.github.io/mediacapture-main/#event-mediastream-addtrack) event with a new [MediaStreamTrack](https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack) is generated for each [track](https://w3c.github.io/mediacapture-fromelement/#dfn-track) that was not previously selected or enabled; and a [removetrack](https://w3c.github.io/mediacapture-main/#event-mediastream-removetrack) events is generated for each [track](https://w3c.github.io/mediacapture-fromelement/#dfn-track) that ceases to be selected or enabled. A [MediaStreamTrack](https://www.w3.org/TR/mediacapture-streams/#dom-mediastreamtrack) MUST end prior to being removed from the [MediaStream](https://www.w3.org/TR/mediacapture-streams/#dom-mediastream).

I'll also note that the `addtrack` event on `AudioTrackList` and `VideoTrackList` in the media element spec is [fired sync](https://html.spec.whatwg.org/multipage/media.html#found-another-audio-track), while the `change` event on the same objects is [fired async](https://html.spec.whatwg.org/multipage/media.html#toggle-audio-track).

-- 
GitHub Notification of comment by Pehrsons
Please view or discuss this issue at https://github.com/w3c/mediacapture-fromelement/issues/100#issuecomment-2158187990 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 10 June 2024 12:16:04 UTC