Bug 221916

Summary: MediaRecorder.stop() does not work correctly when recording has been paused.
Product: WebKit Reporter: David Mannion <dmannion>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Major CC: clopez, eric.carlson, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://github.com/web-platform-tests/wpt/pull/27638
Attachments:
Description Flags
Patch none

David Mannion
Reported 2021-02-15 12:58:02 PST
MediaRecorder::stopRecordingInternal() is not setting the state = RecordingState::Inactive when the current state == RecordingState::Paused. The current code: 316 if (state() != RecordingState::Recording) { 317 completionHandler(); 318 return; 319 } should probably be: 316 if (state() === RecordingState::Inactive) { 317 completionHandler(); 318 return; 319 } The problem can be reproduced using these steps: 1) Start Recording 2) Pause Recording 3) Stop Recording 4) Start Recording Actual result: After step 3, the status is still paused. Also, an exception is thrown and the browser reloads when trying to re-start recording. Expected result: After step 3, the status should be inactive. Also recording should re-start without error.
Attachments
Patch (5.21 KB, patch)
2021-02-15 23:54 PST, youenn fablet
no flags
Radar WebKit Bug Importer
Comment 1 2021-02-15 14:36:03 PST
youenn fablet
Comment 2 2021-02-15 23:23:25 PST
> Actual result: After step 3, the status is still paused. Also, an exception > is thrown and the browser reloads when trying to re-start recording. When you say the browser reloads, does it mean there is a crash and the page reloads?
youenn fablet
Comment 3 2021-02-15 23:54:48 PST
youenn fablet
Comment 4 2021-02-15 23:55:35 PST
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/27638
EWS Watchlist
Comment 5 2021-02-15 23:55:39 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
EWS
Comment 6 2021-02-16 09:57:32 PST
Committed r272911: <https://commits.webkit.org/r272911> All reviewed patches have been landed. Closing bug and clearing flags on attachment 420428 [details].
David Mannion
Comment 7 2021-02-16 10:21:16 PST
(In reply to youenn fablet from comment #2) > > Actual result: After step 3, the status is still paused. Also, an exception > > is thrown and the browser reloads when trying to re-start recording. > When you say the browser reloads, does it mean there is a crash and the page > reloads? My mistake. It crashes if you call resume(). Calling start() throws an exception.
Note You need to log in before you can comment on or make changes to this bug.