Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(753)

Unified Diff: third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp

Issue 1578973002: MediaRecorder: fire onError if the amount of tracks of the MediaStream varies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
index 9713746b3413c61ba99626773af403ac7249b3eb..0b74eaf620a59c8fbcb81f8b07528f6dff67c164 100644
--- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
+++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -55,6 +55,7 @@ MediaRecorder* MediaRecorder::create(ExecutionContext* context, MediaStream* str
MediaRecorder::MediaRecorder(ExecutionContext* context, MediaStream* stream, const MediaRecorderOptions& options, ExceptionState& exceptionState)
: ActiveDOMObject(context)
, m_stream(stream)
+ , m_streamAmountOfTracks(stream->getTracks().size())
, m_mimeType(options.mimeType())
, m_stopped(true)
, m_ignoreMutedMedia(true)
@@ -205,6 +206,8 @@ void MediaRecorder::writeData(const char* data, size_t length, bool lastInSlice)
m_stopped = false;
scheduleDispatchEvent(Event::create(EventTypeNames::start));
}
+ if (m_stream && m_streamAmountOfTracks != m_stream->getTracks().size())
+ onError("Amount of tracks in MediaStream has changed.");
Peter Beverloo 2016/01/13 18:38:01 This fires an `onerror` event each time writeData(
Peter Beverloo 2016/01/13 18:38:01 Will you address the specification bug?
mcasas 2016/01/13 21:50:41 Acknowledged.
mcasas 2016/01/13 21:50:41 Yes, I should update m_streamAmountOfTracks after
// TODO(mcasas): Act as |m_ignoredMutedMedia| instructs if |m_stream| track(s) is in muted() state.
@@ -225,9 +228,6 @@ void MediaRecorder::onError(const WebString& message)
{
// TODO(mcasas): Beef up the Error Event and add the |message|, see https://github.com/w3c/mediacapture-record/issues/31
scheduleDispatchEvent(Event::create(EventTypeNames::error));
-
- if (m_state == State::Recording)
- stopRecording();
}
void MediaRecorder::createBlobEvent(Blob* blob)

Powered by Google App Engine
This is Rietveld 408576698