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

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

Issue 2046403002: Autoplay: disable muted video autoplay if data saver is on. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video-as-images-flag
Patch Set: 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 48ac87082a865889a7cb762c0b8c884fa9adde03..585b1956a9766988a81217370391af7e3b29d9eb 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3664,8 +3664,13 @@ bool HTMLMediaElement::isGestureNeededForPlayback()
if (!m_lockedPendingUserGesture)
return false;
- if (muted() && RuntimeEnabledFeatures::videosAsImagesEnabled())
+ // We want to allow muted video to autoplay if:
+ // - the flag is enabled;
+ // - Data Saver is not enabled;
+ if (muted() && RuntimeEnabledFeatures::videosAsImagesEnabled()
+ && !(document().settings() && document().settings()->dataSaverEnabled())) {
return false;
+ }
if (m_autoplayHelper->isGestureRequirementOverridden())
return false;

Powered by Google App Engine
This is Rietveld 408576698