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

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

Issue 2344353003: Force preload=none and disable autoplay on lowend Android devices. (Closed)
Patch Set: Disable autoplay too. Created 4 years, 3 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 bd2144dfb9b901bed5592bb9e21165eedb07f9da..d4c641699e3b771abe95170f517045a65434594b 100644
--- a/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
@@ -2003,7 +2003,7 @@ WebMediaPlayer::Preload HTMLMediaElement::preloadType() const
{
// Force preload to none for cellular connections or when data saver is explicitly set.
if (networkStateNotifier().isCellularConnectionType()
- || (document().settings() && document().settings()->dataSaverEnabled())) {
+ || (document().settings() && (document().settings()->dataSaverEnabled() || document().settings()->forcePreloadNoneForMediaElements()))) {
foolip 2016/09/19 13:58:54 Makes sense, as long as it's OK that calling play(
DaleCurtis 2016/09/19 21:04:46 Yes, this is fine since it's still relatively prot
UseCounter::count(document(), UseCounter::HTMLMediaElementPreloadForcedNone);
return WebMediaPlayer::PreloadNone;
}

Powered by Google App Engine
This is Rietveld 408576698