Bug 222285 - MediaRecorder.requestData() not returning all captured media after a pause
Summary: MediaRecorder.requestData() not returning all captured media after a pause
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari Technology Preview
Hardware: iPhone / iPad iOS 14
: P2 Normal
Assignee: youenn fablet
Keywords: InRadar
Depends on:
Reported: 2021-02-22 12:32 PST by David Mannion
Modified: 2021-03-09 09:38 PST (History)
8 users (show)

See Also:

Patch (11.06 KB, patch)
2021-03-09 02:49 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Mannion 2021-02-22 12:32:54 PST
iPadOS 14.5 BETA
Safari 14.1

Not sure which build I'm using.

When the mediaRecorder is paused and then requestData() is called, the onDataAvailable event is fired, but only 1117 bytes are returned (header???).  This is true even if requestData() is called inside a setTimeout with a 10 sec delay.  The recorded media can not be played until a second call to requestData() is made.

requestData should "raise a dataavailable event containing a Blob object of the captured media as it was when the method was called", not just the first 1117 bytes.

See: https://jsfiddle.net/drmannion/b184akv7/
1) click Start Camera
2) Click Start Recording
3) Click Pause.  In the console, notice that event.data size is 1117
4) Click Play.  Notice that there is no video to play in the video element. In the console, the current blob array only contains one blob with 1117 bytes.  Also note that the play button called requestData() again and this time the dataavailable event fired with the rest of the recorded data.
5) Click Play again.  Now the recorded video plays.  In the console, the current blob array now has two blobs.
Comment 1 Radar WebKit Bug Importer 2021-03-01 12:33:13 PST
Comment 2 youenn fablet 2021-03-09 02:49:29 PST
Created attachment 422682 [details]
Comment 3 EWS 2021-03-09 09:38:51 PST
Committed r274154: <https://commits.webkit.org/r274154>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422682 [details].