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

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: review comments 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
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79e041bfec69f2a9bf8b83b4269f2cda819acd28..fd5da689daeeb82e2e8fd1ce5960b3747ebd1630 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -3686,8 +3686,13 @@ bool HTMLMediaElement::isGestureNeededForPlayback() const
if (!m_lockedPendingUserGesture)
return false;
- if (muted() && RuntimeEnabledFeatures::autoplayMutedVideosEnabled())
+ // We want to allow muted video to autoplay if:
+ // - the flag is enabled;
+ // - Data Saver is not enabled;
+ if (muted() && RuntimeEnabledFeatures::autoplayMutedVideosEnabled()
+ && !(document().settings() && document().settings()->dataSaverEnabled())) {
return false;
+ }
if (m_autoplayHelper->isGestureRequirementOverridden())
return false;
« no previous file with comments | « third_party/WebKit/LayoutTests/media/autoplay-muted-datasaver-on.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698