| Index: chrome/android/java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java
|
| index f05d6ae9819d64c503108ec3427a246bafa148f4..eddf53906936b49f3d72276c9073ee662a86d691 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/AbstractMediaRouteController.java
|
| @@ -330,18 +330,19 @@ public abstract class AbstractMediaRouteController implements MediaRouteControll
|
| for (UiListener listener : mUiListeners) {
|
| listener.onRouteSelected(route.getName(), this);
|
| }
|
| - if (mMediaStateListener == null) return;
|
| if (!canCastMedia()) return;
|
| - startCastingVideo(route);
|
| - }
|
| -
|
| - private void startCastingVideo(RouteInfo route) {
|
| if (mMediaStateListener == null) return;
|
| mMediaStateListener.pauseLocal();
|
| mMediaStateListener.onCastStarting(route.getName());
|
| + startCastingVideo();
|
| + }
|
| +
|
| + // This exists for compatibility with old downstream code
|
| + // TODO(aberent) convert to abstract
|
| + protected void startCastingVideo() {
|
| String url = mMediaStateListener.getSourceUrl();
|
| Uri uri = url == null ? null : Uri.parse(url);
|
| - setDataSource(uri, mMediaStateListener.getCookies(), mMediaStateListener.getUserAgent());
|
| + setDataSource(uri, mMediaStateListener.getCookies());
|
| prepareAsync(
|
| mMediaStateListener.getFrameUrl(), mMediaStateListener.getStartPositionMillis());
|
| }
|
| @@ -585,27 +586,13 @@ public abstract class AbstractMediaRouteController implements MediaRouteControll
|
| return getMediaStateListener().getPosterBitmap();
|
| }
|
|
|
| - /**
|
| - * Called to prepare the remote playback asyncronously. onPrepared() of the current remote media
|
| - * player object is called when the player is ready.
|
| - *
|
| - * @param startPositionMillis indicates where in the stream to start playing
|
| - */
|
| - protected abstract void prepareAsync(String frameUrl, long startPositionMillis);
|
| -
|
| - // TODO(aberent): Temp to change args while avoiding need for two sided patch for YT.
|
| - void setDataSource(Uri uri, String cookies, String userAgent) {
|
| - setDataSource(uri, cookies);
|
| - };
|
| + // This exists for compatibility with old downstream code
|
| + // TODO(aberent) remove
|
| + protected void prepareAsync(String frameUrl, long startPositionMillis){};
|
|
|
| - /**
|
| - * Temp default version to allow override in YouTubeMediaRouteController, while not
|
| - * requiring it in DefaultMediaRouteController.
|
| - * TODO(aberent): Fix YT and remove.
|
| - * @param uri
|
| - * @param cookies
|
| - */
|
| - public void setDataSource(Uri uri, String cookies) {};
|
| + // This exists for compatibility with old downstream code
|
| + // TODO(aberent) remove
|
| + protected void setDataSource(Uri uri, String cookies){};
|
|
|
| protected boolean reconnectAnyExistingRoute() {
|
| // Temp version to avoid two sided patch while removing
|
| @@ -613,6 +600,12 @@ public abstract class AbstractMediaRouteController implements MediaRouteControll
|
| };
|
|
|
| @Override
|
| + public void checkIfPlayableRemotely(String sourceUrl, String frameUrl, String cookies,
|
| + String userAgent, MediaValidationCallback callback) {
|
| + callback.onResult(true, sourceUrl, frameUrl);
|
| + }
|
| +
|
| + @Override
|
| public String getUriPlaying() {
|
| return null;
|
| }
|
|
|