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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2818013002: [Media] Add a feature flag to pause bg video only players. (Closed)
Patch Set: Created 3 years, 8 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 | « media/base/media_switches.cc ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 1c0e215649791c3794e6eebccd40fa29f221163a..96ba8b569f4cc125fcd33c88f230e590f4ec849a 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -130,6 +130,10 @@ bool IsBackgroundVideoTrackOptimizationEnabled() {
return base::FeatureList::IsEnabled(kBackgroundVideoTrackOptimization);
}
+bool IsBackgroundVideoPauseOptimizationEnabled() {
+ return base::FeatureList::IsEnabled(kBackgroundVideoPauseOptimization);
+}
+
bool IsNetworkStateError(blink::WebMediaPlayer::NetworkState state) {
bool result = state == blink::WebMediaPlayer::kNetworkStateFormatError ||
state == blink::WebMediaPlayer::kNetworkStateNetworkError ||
@@ -2201,7 +2205,7 @@ bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
// Otherwise only pause if the optimization is on and it's a video-only
// optimization candidate.
- return IsBackgroundVideoTrackOptimizationEnabled() && !HasAudio() &&
+ return IsBackgroundVideoPauseOptimizationEnabled() && !HasAudio() &&
IsBackgroundOptimizationCandidate();
}
« no previous file with comments | « media/base/media_switches.cc ('k') | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698