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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1766783003: Expand suspension of idle media players to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notify_pause
Patch Set: Simplify. Created 4 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: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 8831cf001626891686c020b39d8f5846f3b9cb68..1b16426b27accd1744c869842b9708f08007bf00 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -1511,12 +1511,18 @@ void WebMediaPlayerAndroid::OnWaitingForDecryptionKey() {
encrypted_client_->didResumePlaybackBlockedForKey();
}
-void WebMediaPlayerAndroid::OnHidden(bool must_suspend) {
+void WebMediaPlayerAndroid::OnHidden() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableMediaSuspend)) {
return;
}
+ OnSuspendRequested(false);
+}
+
+void WebMediaPlayerAndroid::OnShown() {}
+
+void WebMediaPlayerAndroid::OnSuspendRequested(bool must_suspend) {
// If we're idle or playing video, pause and release resources; audio only
// players are allowed to continue playing in the background unless indicated
sandersd (OOO until July 31) 2016/03/10 19:37:00 "background" isn't implicitly the correct word her
DaleCurtis 2016/03/10 23:11:36 Removed.
// otherwise by the call.
@@ -1524,8 +1530,6 @@ void WebMediaPlayerAndroid::OnHidden(bool must_suspend) {
SuspendAndReleaseResources();
}
-void WebMediaPlayerAndroid::OnShown() {}
-
void WebMediaPlayerAndroid::OnPlay() {
play();
client_->playbackStateChanged();

Powered by Google App Engine
This is Rietveld 408576698