Closed Bug 1496383 Opened 3 years ago Closed 3 years ago
Recorder state error cases does not match its W3C spec
46 bytes, text/x-phabricator-request
|Details | Review|
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 Steps to reproduce: In the MediaRecorder implementation (dom/media/MediaRecorder.cpp), specifically MediaRecorder.pause() and MediaRecorder.resume(), conditions of NS_ERROR_DOM_INVALID_STATE_ERR does not match to the W3C MediaRecorder spec: https://w3c.github.io/mediacapture-record/#dom-mediarecorder-pause . I am currently writing a patch to resolve it. Actual results: In Firefox implementation (in dom/media/MediaRecorder.cpp): pause(): if (state != Recording) => NS_ERROR_DOM_INVALID_STATE_ERR resume(): if (state != Paused) => NS_ERROR_DOM_INVALID_STATE_ERR Expected results: W3C standard states: pause(): if (state == inactive) => NS_ERROR_DOM_INVALID_STATE_ERR resume(): if (state == inactive) => NS_ERROR_DOM_INVALID_STATE_ERR
Component: Untriaged → Audio/Video: Recording
Product: Firefox → Core
Make sure to let us know when you have a patch ready, thanks!
Assignee: nobody → k.bumsik
Priority: -- → P2
Fix a bug that the current MediaRecorder's state error cases does not match the W3C spec. pause() and resume() should throw an INVAILD_STATE_ERR only when it is inactive state, making them idempotent. Simply changing if statements are enough because the underlying encoder object (TrackEncoder) will ignore Suspend/Resume calls when it is already suspended/recording so there won't be side-effects by multiple pause()/resume() calls.
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/integration/autoland/rev/a3a767ad55fb Fix state error cases of MediaRecorder to match the W3C spec r=jya
You need to log in before you can comment on or make changes to this bug.