Closed Bug 1458538 Opened 6 years ago Closed 6 years ago

[ MediaRecorder ] The Pause and resume events don't work in Firefox

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: badr, Assigned: k.bumsik)

References

Details

(Keywords: dev-doc-complete)

Attachments

(2 files)

Attached file MediaRecorderTest.html
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36

Steps to reproduce:

I've called the following methods after I started the mediaRecorder  :
mediaRecorder.pause();
then :
mediaRecorder.resume();

[ Please, check out the full code in the attachments ]


Actual results:

When I call the mediaRecorder.pause() method, the mediaRecorder is actually paused but it doesn't fire the pause event ( onpause ), and the same thing for resume.


Expected results:

It should call the mediaRecorder.onpause() and  mediaRecorder.onresume() event handlers .
Severity: normal → critical
Component: Untriaged → Audio/Video
Priority: -- → P1
Product: Firefox → Core
Component: Audio/Video → Audio/Video: Recording
Severity: critical → normal
Priority: P1 → P3
Hi, I noticed this while working on Bug 1496383. After I looked at the source code (dom/media/MediaRecorder.cpp) I realized it never DispatchSimpleEvent("pause") and DispatchSimpleEvent("resume"). I would like to work on a patch. Could anyone assign me to upload a patch?
This resolves the two problems of MediaRecorder:

1. MediaRecorder does not fire pause/resume events when the corresponding methods are called, as mentioned in D7910.
2. The WebIDL for MediaRecorder does not specify onpause/onresume event handler attributes neither.

DispatchSimpleEvent() is used because there are no event attributes needed.
The patch to add pause/resume events is just accepted. As I'm not assignee for now I cannot add "checkin-needed" keyword here. Could anyone add "checkin-needed" or make the bug patch landed? Thanks!
Assignee: nobody → k.bumsik
Keywords: checkin-needed
Pushed by rgurzau@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/8f0aa4187619
Add pause and resume events for MediaRecorder. r=bzbarsky
Keywords: checkin-needed
Backed out changeset 8f0aa4187619 (Bug 1458538) for idlharness.window.html failures.

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=8f0aa41876197fc701ddadb73eee8edaa753af19

Backout link: https://hg.mozilla.org/integration/mozilla-inbound/rev/3854b434407792df13fad738667b042e2ebb0449

Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=204367845&repo=mozilla-inbound&lineNumber=4272

[task 2018-10-09T23:54:05.556Z] 23:54:05     INFO - TEST-START | /mediacapture-record/idlharness.window.html
[task 2018-10-09T23:54:06.183Z] 23:54:06     INFO - 
[task 2018-10-09T23:54:06.183Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface object name 
[task 2018-10-09T23:54:06.184Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: existence and properties of interface prototype object 
[task 2018-10-09T23:54:06.184Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: existence and properties of interface prototype object's "constructor" property 
[task 2018-10-09T23:54:06.184Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: existence and properties of interface prototype object's @@unscopables property 
[task 2018-10-09T23:54:06.185Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute stream 
[task 2018-10-09T23:54:06.185Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute mimeType 
[task 2018-10-09T23:54:06.185Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute state 
[task 2018-10-09T23:54:06.186Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute onstart 
[task 2018-10-09T23:54:06.187Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute onstop 
[task 2018-10-09T23:54:06.188Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute ondataavailable 
[task 2018-10-09T23:54:06.188Z] 23:54:06     INFO - TEST-UNEXPECTED-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute onpause - expected FAIL
[task 2018-10-09T23:54:06.188Z] 23:54:06     INFO - TEST-INFO | expected FAIL
[task 2018-10-09T23:54:06.189Z] 23:54:06     INFO - 
[task 2018-10-09T23:54:06.189Z] 23:54:06     INFO - TEST-UNEXPECTED-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: attribute onresume - expected FAIL
[task 2018-10-09T23:54:06.189Z] 23:54:06     INFO - TEST-INFO | expected FAIL
[task 2018-10-09T23:54:06.196Z] 23:54:06     INFO - 
[task 2018-10-09T23:54:06.196Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: operation requestData() 
[task 2018-10-09T23:54:06.197Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: operation isTypeSupported(DOMString) 
[task 2018-10-09T23:54:06.197Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder must be primary interface of [object MediaRecorder] 
[task 2018-10-09T23:54:06.198Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | Stringification of [object MediaRecorder] 
[task 2018-10-09T23:54:06.198Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "stream" with the proper type 
[task 2018-10-09T23:54:06.198Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "mimeType" with the proper type 
[task 2018-10-09T23:54:06.198Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "state" with the proper type 
[task 2018-10-09T23:54:06.199Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "onstart" with the proper type 
[task 2018-10-09T23:54:06.199Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "onstop" with the proper type 
[task 2018-10-09T23:54:06.199Z] 23:54:06     INFO - TEST-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "ondataavailable" with the proper type 
[task 2018-10-09T23:54:06.199Z] 23:54:06     INFO - TEST-UNEXPECTED-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "onpause" with the proper type - expected FAIL
[task 2018-10-09T23:54:06.200Z] 23:54:06     INFO - TEST-INFO | expected FAIL
[task 2018-10-09T23:54:06.200Z] 23:54:06     INFO - 
[task 2018-10-09T23:54:06.200Z] 23:54:06     INFO - TEST-UNEXPECTED-PASS | /mediacapture-record/idlharness.window.html | MediaRecorder interface: [object MediaRecorder] must inherit property "onresume" with the proper type - expected FAIL
[task 2018-10-09T23:54:06.201Z] 23:54:06     INFO - TEST-INFO | expected FAIL
[task 2018-10-09T23:54:06.216Z] 23:54:06     INFO - .................................
[task 2018-10-09T23:54:06.217Z] 23:54:06     INFO - TEST-OK | /mediacapture-record/idlharness.window.html | took 638ms
Flags: needinfo?(k.bumsik)
It looks like the failure caused by the updated WebIDL. I'll check it out and push a patch for this.
Flags: needinfo?(k.bumsik)
indeed you need to update the web-platform-test result expectation.

it's located there:
https://searchfox.org/mozilla-central/source/testing/web-platform/meta/mediacapture-record/idlharness.window.js.ini

for tests that used to fail but are now passing, it's just a matter of removing the corresponding entries.

More information in: https://developer.mozilla.org/en-US/docs/Mozilla/QA/web-platform-tests

You can test locally with the command:

./mach web-platform-tests --include=mediacapture-record

you can create this as an extra commit, with a dependency on the previous one.
I was about to ask about it. Thanks for the information.
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Jean-Yves, did you see the question in the Phabricator review?
Flags: needinfo?(jyavenard)
Pushed by jyavenard@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/80b0b8b446fd
Add pause and resume events for MediaRecorder. r=jya,bzbarsky
Keywords: checkin-needed
already pushed. thank you
Flags: needinfo?(jyavenard)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/80b0b8b446fd
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
This implemented the pause and resume events for MediaRecorder, and the corresponding onpause and onresume handlers. We're fixing the behavior and spec to be more web compatible in bug 1514016 so please take that into account when writing dev docs.
Keywords: dev-doc-needed
(In reply to Andreas Pehrson [:pehrsons] from comment #14)
> This implemented the pause and resume events for MediaRecorder, and the
> corresponding onpause and onresume handlers. We're fixing the behavior and
> spec to be more web compatible in bug 1514016 so please take that into
> account when writing dev docs.

Ah. I think when I originally documented MediaRecorder, I just wrote all the reference pages including pause/onpause and reume/onresume, and assumed that because pause()/resume() worked, they would fire. They are listed as being supported since Firefox 25. That looks not to be the case ;-)

I'll see to it that these details are updated asap next year.

For now, I've added a note to the Fx65 rel notes:
https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Releases/65#APIs
QA Whiteboard: [good first verify]
No longer blocks: 1514016
Depends on: 1514016

I have reproduced this bug with Nightly 61.0a1 (2018-05-02) on Windows 10, 64 Bit!

This bug's fix is verified with latest Beta 65.0b10!

Build ID - 20190110221328
User Agent - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

QA Whiteboard: [good first verify] → [good first verify] [testday20190111]

BCD PR filed to correct the compatibility info for onpause and onresume: https://github.com/mdn/browser-compat-data/pull/3334

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: