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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java

Issue 1931263002: [MediaFling, UI] Always show play/pause in notification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 4 years, 7 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 | « chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java
index 56c73cc9b319a2f08d8711cf506def80ec26456c..0f34f4b7809b7649f9d6f0047c867057e5b0e41b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/RemoteMediaPlayerController.java
@@ -161,6 +161,7 @@ public class RemoteMediaPlayerController implements MediaRouteController.UiListe
mNotificationControl = CastNotificationControl.getOrCreate(
mChromeVideoActivity.get(), controller);
+ mNotificationControl.setPosterBitmap(getPoster());
controller.prepareMediaRoute();
controller.addUiListener(this);
@@ -242,20 +243,6 @@ public class RemoteMediaPlayerController implements MediaRouteController.UiListe
f.show(fm, "android.support.v7.mediarouter:MediaRouteControllerDialogFragment");
}
- /**
- * Starts up the notification and lock screen with the given playback state.
- *
- * @param initialState the initial state of the notification
- * @param mediaRouteController the mediaRouteController for which these are needed
- */
- public void startNotification(PlayerState initialState,
- MediaRouteController mediaRouteController) {
- mCurrentRouteController = mediaRouteController;
- createNotificationControl();
- CastNotificationControl notificationControl = getNotificationControl();
- if (notificationControl != null) notificationControl.show(initialState);
- }
-
/**
* @return the currently playing MediaRouteController
*/
@@ -275,25 +262,12 @@ public class RemoteMediaPlayerController implements MediaRouteController.UiListe
return mNotificationControl;
}
- private void createNotificationControl() {
- mNotificationControl = CastNotificationControl.getOrCreate(
- mChromeVideoActivity.get(), mCurrentRouteController);
- mNotificationControl.setPosterBitmap(getPoster());
- }
-
@Override
public void onPrepared(MediaRouteController mediaRouteController) {
-
- startNotification(PlayerState.PLAYING, mediaRouteController);
}
@Override
public void onPlaybackStateChanged(PlayerState newState) {
- if (newState == PlayerState.PLAYING || newState == PlayerState.LOADING
- || newState == PlayerState.PAUSED) {
- CastNotificationControl notificationControl = getNotificationControl();
- if (notificationControl != null) notificationControl.show(newState);
- }
}
@Override
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/media/remote/CastNotificationControl.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698