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

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: Renamed the flag to autoplay-muted-videos 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 c938c39946b299731088bc3646a3cd1c29398fb9..441ee5b55a8b6e020d888087c1062bc553bea0e0 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3673,8 +3673,16 @@ void HTMLMediaElement::unlockUserGesture()
bool HTMLMediaElement::isGestureNeededForPlayback() const
{
- return m_lockedPendingUserGesture
- && !m_autoplayHelper->isGestureRequirementOverridden();
+ if (!m_lockedPendingUserGesture)
+ return false;
+
+ if (muted() && RuntimeEnabledFeatures::autoplayMutedVideosEnabled())
+ return false;
+
+ if (m_autoplayHelper->isGestureRequirementOverridden())
+ return false;
+
+ return true;
}
void HTMLMediaElement::setNetworkState(NetworkState state)
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-muted.html ('k') | third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698