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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2655723002: [Video, Android] Pause video only players ignoring duration and keyframes (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | 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 3b0e829680b4c2e05a638fcc3fd8e525624c166b..71cfc3580dc8a49da32e1b4e2856bf1449ddc19a 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -2154,10 +2154,15 @@ bool WebMediaPlayerImpl::ShouldDisableVideoWhenHidden() const {
bool WebMediaPlayerImpl::IsBackgroundOptimizationCandidate() const {
DCHECK(main_task_runner_->BelongsToCurrentThread());
-// Don't optimize players being Cast (Android only).
#if defined(OS_ANDROID) // WMPI_CAST
+ // Don't optimize players being Cast.
if (isRemote())
return false;
+
+ // Video-only players are always optimized (paused) on Android.
+ // Don't check the keyframe distance and duration.
+ if (!hasAudio() && hasVideo())
+ return true;
#endif // defined(OS_ANDROID)
// Don't optimize audio-only or streaming players.
« no previous file with comments | « no previous file | media/blink/webmediaplayer_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698