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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2643033004: [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 5ac86d7625add4051364efeef09063c760add03b..d908e699612de5a34dddc5fa6138d31b45e683d3 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -2156,10 +2156,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