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

Unified Diff: third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp

Issue 1599533003: MediaCaptureFromElement: add support for audio captureStream(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using refptr iso WeakPtr Created 4 years, 7 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/mediacapturefromelement/HTMLMediaElementCapture.cpp
diff --git a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp
index 478a74db936ae535ef8852c4ddb8a58bf16d5d13..aad4dab4c61a1e4856448a4223b901f9342494eb 100644
--- a/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp
+++ b/third_party/WebKit/Source/modules/mediacapturefromelement/HTMLMediaElementCapture.cpp
@@ -6,6 +6,8 @@
#include "core/dom/ExceptionCode.h"
#include "core/html/HTMLMediaElement.h"
+#include "core/html/track/AudioTrackList.h"
+#include "core/html/track/VideoTrackList.h"
#include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
#include "modules/encryptedmedia/MediaKeys.h"
#include "modules/mediastream/MediaStream.h"
@@ -37,17 +39,14 @@ MediaStream* HTMLMediaElementCapture::captureStream(HTMLMediaElement& element, E
return MediaStream::create(element.getExecutionContext(), MediaStreamRegistry::registry().lookupMediaStreamDescriptor(element.currentSrc().getString()));
}
- // TODO(mcasas): Only <video> tags are supported at the moment.
- if (element.isHTMLAudioElement()) {
- NOTIMPLEMENTED();
- return nullptr;
- }
-
WebMediaStream webStream;
webStream.initialize(WebVector<WebMediaStreamTrack>(), WebVector<WebMediaStreamTrack>());
MediaStreamCenter::instance().didCreateMediaStream(webStream);
- Platform::current()->createHTMLVideoElementCapturer(&webStream, element.webMediaPlayer());
+ if (element.hasVideo())
+ Platform::current()->createHTMLVideoElementCapturer(&webStream, element.webMediaPlayer());
+ if (element.hasAudio())
+ Platform::current()->createHTMLAudioElementCapturer(&webStream, element.webMediaPlayer());
return MediaStream::create(element.getExecutionContext(), webStream);
}

Powered by Google App Engine
This is Rietveld 408576698