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

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

Issue 1607043002: Only show cast button if video can be cast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix null pointer error (found by telemetry smoke tests!) Created 4 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
Index: chrome/android/java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java
index 05b4f6031e307cab7255f8b1aa7b01d037658547..673be2e691711cb54a3d0f193d7836ceca6b5832 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/media/remote/MediaRouteController.java
@@ -81,11 +81,6 @@ public interface MediaRouteController extends TransportControl.Listener {
String getCookies();
/**
- * @return the User Agent string
- */
- String getUserAgent();
-
- /**
* @return the frame URL
*/
String getFrameUrl();
@@ -170,6 +165,19 @@ public interface MediaRouteController extends TransportControl.Listener {
}
/**
+ * Interface for returning the result of checking whether the media element is playable
+ * remotely.
+ */
+ static interface MediaValidationCallback {
+ /**
+ * Function to deliver the result
+ * @param isPlayable true if the media element is playable, false if not
+ * @param revisedSourceUrl The source url to send to the remote device
+ * @param revisedFrameUrl The frame url to send to the remote device
+ */
+ void onResult(boolean isPlayable, String revisedSourceUrl, String revisedFrameUrl);
+ }
+ /**
* Scan routes, and set up the MediaRouter object. This is called at every time we need to reset
* the state. Because of that, this function is idempotent. If that changes in the future, where
* this function gets called needs to be re-evaluated.
@@ -329,6 +337,18 @@ public interface MediaRouteController extends TransportControl.Listener {
void onRouteSelected(MediaStateListener player, MediaRouter router, RouteInfo route);
/**
+ * Potentially asynchronous check of whether the media element is playable on remote players.
+ * @param sourceUrl the URL of the media element
+ * @param frameUrl the URL of the frame
+ * @param cookies the cookies for the media element
+ * @param userAgent the user agent
+ * @param callback the callback through which the result will be returned. The callback will be
+ * called either from within the call, or later on the UI thread.
+ */
+ void checkIfPlayableRemotely(String sourceUrl, String frameUrl, String cookies,
+ String userAgent, MediaValidationCallback callback);
+
+ /**
* @return The Uri of the currently playing video
*/
@VisibleForTesting String getUriPlaying();

Powered by Google App Engine
This is Rietveld 408576698