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); |
} |