mediacapture-record
mediacapture-record copied to clipboard
Ensure that the error event is the last event to be fired
http://w3c.github.io/mediacapture-record/MediaRecorder.html#general-principles
If recording has been started and not yet stopped when the error occurs, then after raising the error, the UA must fire a
dataavailable event, containing any data that it has gathered, and then a stop event.
This seems odd, it will mean that sometimes there will be data after the error event and sometimes there will not. How about instead requiring that if there is any data, that the dataavailable event be fired before the error event? Assuming that both the data and the error originates from the same bits of code then that ought to also match the actual order things happen in.
I agree, but this seems to be implemented by both Gecko (here and here -- note that the error is not followed by an return NS_ERROR_FAILURE) and Chromium (here).
The Section is now non-normative. What do you think we should do?
Just changing the order of the events there should fix the problem, implementation-wise I guess it's simple enough?
@foolip, I think I should homogenise all these sequences so that the Error event is the last one; potentially after an ondataavailable event and/or an onstop event, sgty?
Yep, firing the error event last is exactly what I'm asking for :)