Bug 261964 - Pausing MediaRecorder still continues to call ondataavailable at every timeslice event
Summary: Pausing MediaRecorder still continues to call ondataavailable at every timesl...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: Safari 17
Hardware: iPhone / iPad iOS 17
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-22 12:50 PDT by Daniel Cabrera
Modified: 2023-09-25 23:40 PDT (History)
5 users (show)

See Also:


Attachments
Sample html/javascript to replicate issue (4.19 KB, application/x-zip-compressed)
2023-09-22 12:50 PDT, Daniel Cabrera
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Cabrera 2023-09-22 12:50:08 PDT
Created attachment 467826 [details]
Sample html/javascript to replicate issue

When using MediaRecorder with a specified timeslice property, ondataavailable keeps getting called on every timeslice event, regardless if MediaRecorder has been paused. Have replicated this occurring on Safari for iOS 16 + 17 as well as on macOS Ventura 13.5.2 Safari version 16.6.

Issue:
The attached example has a timeslice of 5000 that is supplied on mediaRecorder.start(5000). When recording is started the mediaRecorder.ondataavailable event will fire every 5 seconds. Upon calling mediaRecorder.pause(), mediaRecorder.onpause event fires and mediaRecorder.requestData() is called which should result in mediaRecorder.ondataavailable triggering one more time and then stop/pause (this is the current behavior with other browsers). Safari iOS 16 + 17 continues to call mediaRecorder.ondataavailable at every timeslice event with the same blob even though mediaRecorder.pause() was called.

Expected behavior:
Upon calling mediaRecorder.pause(), mediaRecorder.ondataavailable should not continue to fire continuously.

Replicating:
1. Launch index.html from attached zip
2. Tap the Record button
3. Record several seconds then tap the Pause button.
4. mediaRecorder.ondataavailable will continue to be called every 5 seconds. Added a debug div that will show the consolelog output on the screen and you'll notice ondataavailable... continue to get outputed every 5 seconds.
Comment 1 Radar WebKit Bug Importer 2023-09-25 01:07:16 PDT
<rdar://problem/115979604>
Comment 2 youenn fablet 2023-09-25 01:19:16 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18150
Comment 3 EWS 2023-09-25 23:40:13 PDT
Committed 268433@main (849a8db62663): <https://commits.webkit.org/268433@main>

Reviewed commits have been landed. Closing PR #18150 and removing active labels.