Closed Bug 1496383 Opened 7 years ago Closed 7 years ago

MediaRecorder state error cases does not match its W3C spec

Categories

(Core :: Audio/Video: Recording, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: k.bumsik, Assigned: k.bumsik)

References

Details

Attachments

(1 file)

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
Depends on: 1496377
No longer depends on: 1496377
See Also: → 1496377
Blocks: 1496377
Make sure to let us know when you have a patch ready, thanks!
Assignee: nobody → k.bumsik
Priority: -- → P2
Depends on: 1496550
No longer depends on: 1496550
QA Contact: drno
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.
QA Contact: drno
See Also: → 1458538
Keywords: checkin-needed
Pushed by cbrindusan@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a3a767ad55fb Fix state error cases of MediaRecorder to match the W3C spec r=jya
Keywords: checkin-needed
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: