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

Unified Diff: third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp

Issue 1815033003: Add srcObject attribute of type MediaStream to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: philipj's comments Created 4 years, 8 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/platform/exported/WebMediaPlayerSource.cpp
diff --git a/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp b/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..7ebfd243708c79ee2848cf48d8d45caaa5aa6c05
--- /dev/null
+++ b/third_party/WebKit/Source/platform/exported/WebMediaPlayerSource.cpp
@@ -0,0 +1,53 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "public/platform/WebMediaPlayerSource.h"
+
+namespace blink {
+
+WebMediaPlayerSource::WebMediaPlayerSource()
+{
+}
+
+WebMediaPlayerSource::WebMediaPlayerSource(const WebURL& url)
+ : m_url(url)
+{
+}
+
+WebMediaPlayerSource::WebMediaPlayerSource(const WebMediaStream& mediaStream)
+ : m_mediaStream(mediaStream)
+{
+}
+
+WebMediaPlayerSource::~WebMediaPlayerSource()
+{
+ m_mediaStream.reset();
+}
+
+bool WebMediaPlayerSource::isURL() const
+{
+ return !m_url.isEmpty();
+}
+
+WebURL WebMediaPlayerSource::getAsURL() const
+{
+ return m_url;
+}
+
+bool WebMediaPlayerSource::isMediaProviderObject() const
+{
+ return isMediaStream();
+}
+
+bool WebMediaPlayerSource::isMediaStream() const
+{
+ return !m_mediaStream.isNull();
+}
+
+WebMediaStream WebMediaPlayerSource::getAsMediaStream() const
+{
+ return m_mediaStream;
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698