Changeset 263671 in webkit
- Timestamp:
- Jun 29, 2020, 11:32:10 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r263669 r263671 1 2020-06-29 Youenn Fablet <youenn@apple.com> 2 3 Support MediaRecorder.onstart 4 https://bugs.webkit.org/show_bug.cgi?id=213720 5 6 Reviewed by Darin Adler. 7 8 * http/wpt/mediarecorder/MediaRecorder-start-timeSlice-expected.txt: 9 * http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html: 10 1 11 2020-06-29 Karl Rackler <rackler@apple.com> 2 12 -
trunk/LayoutTests/http/wpt/mediarecorder/MediaRecorder-start-timeSlice-expected.txt
r263651 r263671 1 1 2 2 PASS Make sure that MediaRecorder timeSlice triggers regular ondataavailable events 3 PASS Make sure that MediaRecorder fires onstart on successful start call 3 4 -
trunk/LayoutTests/http/wpt/mediarecorder/MediaRecorder-start-timeSlice.html
r263651 r263671 24 24 await promise; 25 25 }, 'Make sure that MediaRecorder timeSlice triggers regular ondataavailable events'); 26 27 promise_test(async t => { 28 const video = await navigator.mediaDevices.getUserMedia({ audio : true, video : true }); 29 const recorder = new MediaRecorder(video); 30 31 let promise = new Promise(resolve => recorder.onstart = resolve); 32 // We cover the case of invalid ignored timeSlice value by passing -1 here. 33 recorder.start(-1); 34 35 return promise; 36 }, 'Make sure that MediaRecorder fires onstart on successful start call'); 26 37 </script> 27 38 </body> -
trunk/Source/WebCore/ChangeLog
r263662 r263671 1 2020-06-29 Youenn Fablet <youenn@apple.com> 2 3 Support MediaRecorder.onstart 4 https://bugs.webkit.org/show_bug.cgi?id=213720 5 6 Reviewed by Darin Adler. 7 8 Fire start event if MediaRecorder.start is successful. 9 Do some WebIDL clean-up, in particular change timeSlice from long to unsigned long, as per spec. 10 Covered by added test. 11 12 * Modules/mediarecorder/MediaRecorder.cpp: 13 (WebCore::MediaRecorder::startRecording): 14 * Modules/mediarecorder/MediaRecorder.h: 15 * Modules/mediarecorder/MediaRecorder.idl: 16 1 17 2020-06-29 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.cpp
r263651 r263671 127 127 } 128 128 129 ExceptionOr<void> MediaRecorder::startRecording(Optional< int> timeSlice)129 ExceptionOr<void> MediaRecorder::startRecording(Optional<unsigned> timeSlice) 130 130 { 131 131 if (!m_isActive) … … 142 142 143 143 m_private->startRecording([this, pendingActivity = makePendingActivity(*this)](auto&& exception) mutable { 144 if (!m_isActive || !exception)144 if (!m_isActive) 145 145 return; 146 146 147 stopRecordingInternal(); 148 dispatchError(WTFMove(*exception)); 147 if (exception) { 148 stopRecordingInternal(); 149 dispatchError(WTFMove(*exception)); 150 return; 151 } 152 153 dispatchEvent(Event::create(eventNames().startEvent, Event::CanBubble::No, Event::IsCancelable::No)); 149 154 }); 150 155 -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.h
r263651 r263671 70 70 using RefCounted::deref; 71 71 72 ExceptionOr<void> startRecording(Optional< int>);72 ExceptionOr<void> startRecording(Optional<unsigned>); 73 73 ExceptionOr<void> stopRecording(); 74 74 ExceptionOr<void> requestData(); … … 118 118 RecordingState m_state { RecordingState::Inactive }; 119 119 Vector<Ref<MediaStreamTrackPrivate>> m_tracks; 120 Optional< int> m_timeSlice;120 Optional<unsigned> m_timeSlice; 121 121 Timer m_timeSliceTimer; 122 122 -
trunk/Source/WebCore/Modules/mediarecorder/MediaRecorder.idl
r263160 r263671 33 33 [CallWith=Document, MayThrowException] constructor(MediaStream stream, optional MediaRecorderOptions options); 34 34 35 // FIXME: Implement commented out methods/attributes. 36 37 readonly attribute MediaStream stream; 38 // readonly attribute DOMString mimeType; 35 39 readonly attribute RecordingState state; 36 readonly attribute MediaStream stream; 37 // FIXME: Implement these: 38 // readonly attribute DOMString mimeType; 39 // attribute EventHandler onstart; 40 attribute EventHandler onstart; 40 41 attribute EventHandler onstop; 41 42 attribute EventHandler ondataavailable; … … 45 46 // readonly attribute unsigned long videoBitsPerSecond; 46 47 // readonly attribute unsigned long audioBitsPerSecond; 48 // readonly attribute BitrateMode audioBitrateMode; 47 49 48 [MayThrowException, ImplementedAs=startRecording] void start(optional long timeslice);50 [MayThrowException, ImplementedAs=startRecording] void start(optional unsigned long timeslice); 49 51 [ImplementedAs=stopRecording] void stop(); 50 52 // void pause();
Note:
See TracChangeset
for help on using the changeset viewer.