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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2741083002: Disable pausing background video-only players on desktop. (Closed)
Patch Set: Created 3 years, 9 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: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index fa8a90108e049dc4b1464fe5885913816da312dd..ffe116b5605b10b7fcf73d87a56edfe7a73e72a8 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -2153,6 +2153,16 @@ void WebMediaPlayerImpl::ActivateViewportIntersectionMonitoring(bool activate) {
client_->activateViewportIntersectionMonitoring(activate);
}
+// TODO(avayvod): Revert after merging into 58 so we keep getting data on the
+// background video pause behavior on desktop. See https://crbug.com/699106.
+#if !defined(OS_ANDROID)
+
+bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
+ return false;
+}
+
+#else // !defined(OS_ANDROID)
+
bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
// If suspending background video, pause any video that's not remoted or
// not unlocked to play in the background.
@@ -2176,6 +2186,8 @@ bool WebMediaPlayerImpl::ShouldPauseVideoWhenHidden() const {
IsBackgroundOptimizationCandidate();
}
+#endif // !defined(OS_ANDROID)
+
bool WebMediaPlayerImpl::ShouldDisableVideoWhenHidden() const {
// This optimization is behind the flag on all platforms.
if (!IsBackgroundVideoTrackOptimizationEnabled())

Powered by Google App Engine
This is Rietveld 408576698