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

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

Issue 2039773003: [Android] Added a runtime flag to enable autoplay of muted videos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: An attempt to add a layout test. Created 4 years, 6 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 7beecb9dd4be9a28665ac847fe9e6f45f67b085f..48ac87082a865889a7cb762c0b8c884fa9adde03 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3659,10 +3659,18 @@ void HTMLMediaElement::unlockUserGesture()
m_lockedPendingUserGesture = false;
}
-bool HTMLMediaElement::isGestureNeededForPlayback() const
+bool HTMLMediaElement::isGestureNeededForPlayback()
{
- return m_lockedPendingUserGesture
- && !m_autoplayHelper->isGestureRequirementOverridden();
+ if (!m_lockedPendingUserGesture)
+ return false;
+
+ if (muted() && RuntimeEnabledFeatures::videosAsImagesEnabled())
+ return false;
+
+ if (m_autoplayHelper->isGestureRequirementOverridden())
+ return false;
+
+ return true;
}
void HTMLMediaElement::setNetworkState(NetworkState state)

Powered by Google App Engine
This is Rietveld 408576698