Bug 261964

Summary: Pausing MediaRecorder still continues to call ondataavailable at every timeslice event
Product: WebKit Reporter: Daniel Cabrera <dannycabrera>
Component: Web AudioAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, eric.carlson, jer.noble, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: iPhone / iPad   
OS: iOS 17   
Attachments:
Description Flags
Sample html/javascript to replicate issue none

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.