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

Unified Diff: Source/core/html/HTMLVideoElement.cpp

Issue 1254613003: Let the WebMediaPlayer decide whether to use overlay video. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address Xianzhu's Comments Created 5 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
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/layout/LayoutVideo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index 1fd3884597140f252920d6f5e0924fb1c446b25a..db2387f1e9c67b964f248a2c7eb86861ed589bc3 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -38,6 +38,7 @@
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutImage.h"
#include "core/layout/LayoutVideo.h"
+#include "platform/RuntimeEnabledFeatures.h"
#include "platform/UserGestureIndicator.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/ImageBuffer.h"
@@ -244,6 +245,20 @@ bool HTMLVideoElement::webkitDisplayingFullscreen()
return isFullscreen();
}
+bool HTMLVideoElement::usesOverlayFullscreenVideo() const
+{
+ if (RuntimeEnabledFeatures::forceOverlayFullscreenVideoEnabled())
+ return true;
+
+ // TODO(watk): Remove this and the REF check below when the chromium side change to not
+ // set OverlayFullscreenVideo on Android lands. http://crbug.com/511376
+ if (HTMLMediaElement::isMediaStreamURL(sourceURL().string()))
+ return false;
+
+ return RuntimeEnabledFeatures::overlayFullscreenVideoEnabled()
+ || (webMediaPlayer() && webMediaPlayer()->supportsOverlayFullscreenVideo());
+}
+
void HTMLVideoElement::didMoveToNewDocument(Document& oldDocument)
{
if (m_imageLoader)
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/layout/LayoutVideo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698