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

Unified Diff: third_party/WebKit/Source/core/html/HTMLMediaElement.cpp

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add switching of CdmFactory. Created 4 years, 4 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/core/html/HTMLMediaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
index f8f4ba806168d75890c3c02087971e5f04f3daac..e7e8f4c874f29c9bc5b23ac96f30c743345788af 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -451,6 +451,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_autoplayHelper(AutoplayExperimentHelper::create(m_autoplayHelperClient.get()))
, m_remotePlaybackClient(nullptr)
, m_autoplayVisibilityObserver(nullptr)
+ , m_isParentInFullscreen(false)
{
ThreadState::current()->registerPreFinalizer(this);
@@ -3318,6 +3319,23 @@ void HTMLMediaElement::willStopBeingFullscreenElement()
m_inOverlayFullscreenVideo = false;
}
+void HTMLMediaElement::parentEnteredFullscreen()
+{
+ m_isParentInFullscreen = true;
+ // Notify webMediaPlayer() the video enters full screen display.
+ // TODO(xjz): this size check seems not work for youtube videos.
+ if (webMediaPlayer() && (clientWidth() >= document().domWindow()->innerWidth()) && (clientHeight() >= document().domWindow()->innerHeight())) {
+ webMediaPlayer()->videoEnteredFullscreen();
+ }
+}
+
+void HTMLMediaElement::parentExitedFullscreen()
+{
+ m_isParentInFullscreen = false;
+ if (webMediaPlayer())
+ webMediaPlayer()->videoExitedFullscreen();
+}
+
WebLayer* HTMLMediaElement::platformLayer() const
{
return m_webLayer;

Powered by Google App Engine
This is Rietveld 408576698