Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recording a stream while adding/removing a track is not well defined #151

Closed
youennf opened this issue Oct 10, 2018 · 13 comments
Closed

Recording a stream while adding/removing a track is not well defined #151

youennf opened this issue Oct 10, 2018 · 13 comments

Comments

@youennf
Copy link
Contributor

youennf commented Oct 10, 2018

According https://w3c.github.io/mediacapture-record/#event-summary, when adding/removing a track to a stream being recorded, recorder should dispatch a MediaRecorderErrorEvent event.
It is unclear whether this is part of https://w3c.github.io/mediacapture-record/#mediarecorder-methods start step 5.3, in which case it should be UnknownError or something else.

@yellowdoge
Copy link
Member

I'm not sure what the issue is: do you mean that if, upon start(), the Track set has changed (from those presented to the constructor), MediaRecorder should fire a MediaRecorderErrorEvent event? Or that said step 5.3 should also mention the error event itself?

@youennf
Copy link
Contributor Author

youennf commented Oct 12, 2018

step 5.3 does not seem to state that, once started, on track change, we should throw an error event and with which exception. It would be nice to clarify this.

@yellowdoge
Copy link
Member

That's reasonable. Would you mind putting up a PR for it :-) ?

@alvestrand
Copy link
Contributor

Note: events are dispatched, not thrown.... in this case, they would be dispatched to the MediaRecorder object, I assume.
Agree that we need the code to be clear.

@alvestrand
Copy link
Contributor

I remember having the discussion about what to do when the set of tracks changes over the recorder's lifetime. The conclusion (I think) was that so few formats support doing this that we shouldn't bother, and just return an error, but the discussion's result could have been a little more obvious than just an "e.g." in the event methods summary.

@youennf
Copy link
Contributor Author

youennf commented Oct 17, 2018

PTAL at the PR.
I went with InvalidModificationError as error.
I'll write a corresponding WPT test once we agreed on this or another error.

@youennf
Copy link
Contributor Author

youennf commented Oct 18, 2018

Doing a quick check in Chrome and Firefox, this error handling does not seem implemented.

yellowdoge pushed a commit that referenced this issue Oct 18, 2018
@Pehrsons
Copy link
Collaborator

I think the best way to resolve this is by continuing the discussion in the original issue, #4.

@youennf
Copy link
Contributor Author

youennf commented Oct 18, 2018

Let's close this issue then.
I'll upload a WPT test to align with the spec.
We can always revisit spec and tests based on #4

@youennf youennf closed this as completed Oct 18, 2018
@Pehrsons
Copy link
Collaborator

@youennf Did you get around to that WPT test? I can at least not find one containing InvalidModificationError in mediacapture-record.

Also this change went from "MUST stop gathering data" to "MUST immediately stop gathering data, discard any data that it has gathered". For SecurityError it makes sense to discard the data (though does it make sense to still fire "dataavailable"?) but for modifying the track set I'm not so sure. Was this intended?

@youennf
Copy link
Contributor Author

youennf commented Jan 25, 2019

Thanks for pinging me, I forgot about this one.
Test uploaded and up for review.

I see your point about not discarding the data, I agree we should do this.
I am not sure to see any tangible difference between 'immediately stop gathering' and 'stop gathering'.
Should we just use 'stop gathering' everywhere?

@Pehrsons
Copy link
Collaborator

SGTM

@youennf
Copy link
Contributor Author

youennf commented Jan 26, 2019

Filed #162 for not discarding the data.
PR should be WPT testable.

PR also removes 'immediately'.
Maybe the spec could state clearly that the blob MUST be empty in such a case.
Or, the blob content could be cleared in the steps executed as part of the DOM manipulation task source.
Or, if backward compatible, do not fire the event as you point out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants