WebKit MediaRecorderPrivate::startRecording callback should not set audio/video tracks if recorder is stopped
Or maybe add a clean method for MediaRecorderPrivate and call it in MediaRecorder::fetchData fetchDataCallback
Make sure to fire the correct set of events in case MediaRecorder stream has track changes
Created attachment 410620 [details] Patch
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
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/26006
Created attachment 410631 [details] Patch
Comment on attachment 410631 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=410631&action=review > Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp:71 > if (result.hasException()) > return result.releaseException(); > > + result.releaseReturnValue()->stop(); > + As we discussed, I think it would be helpful to have a comment explaining why the private recorder is allocated and abandoned immediately. > Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp:283 > + dispatchError(Exception { InvalidModificationError, "Track cannot be added to or removed from the MediaStream while recording is happening"_s }); s/while recording is happening/while recording/ > LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html:41 > + assert_equals(mediaRecorderErrorEvent.error.name, 'InvalidModificationError', 'the type of error should be UnknownError when track has been added or removed'); s/should be UnknownError when/should be InvalidModificationError when/ > LayoutTests/imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html:60 > + assert_equals(mediaRecorderErrorEvent.error.name, 'InvalidModificationError', 'the type of error should be UnknownError when track has been added or removed'); Ditto.
(In reply to Eric Carlson from comment #7) > Comment on attachment 410631 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=410631&action=review > > > Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp:71 > > if (result.hasException()) > > return result.releaseException(); > > > > + result.releaseReturnValue()->stop(); > > + > > As we discussed, I think it would be helpful to have a comment explaining > why the private recorder is allocated and abandoned immediately. I filed https://bugs.webkit.org/show_bug.cgi?id=217387 to keep track of this refactoring.
Created attachment 410643 [details] Patch for landing
Committed r268119: <https://trac.webkit.org/changeset/268119> All reviewed patches have been landed. Closing bug and clearing flags on attachment 410643 [details].
<rdar://problem/70038607>