Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Chromecast Android API to push a URL to the "ChromeCast" App

So far I've been able to write a webpage that pushes a url to the (what I'm calling) native app in the chromecast device. Through this API I can open a "video_playback" app that sends the URL and some other info, just like in this webpage http://googlecast.github.io/cast-chrome/ to my device and my video plays just fine...

Now I want to do that with the Android API, but it treats that receiver "app" as if it doesn't exist. With some more poking around I found that the actual name of the app is ChromeCast, but all I've been able to do is get a blank screen or a 404 to show up. Is this not supported on the Android app? (ie I'm forced to write my own receiver) or am I doing something wrong?

I perfectly able to open a YouTube app through the Android API and load a video, so most of my code is fine. It seems I just need to figure out what application name and arguments to use in the ApplicationSession.startSession() function.

Any help would be appreciated.-

like image 241
tryexceptpass Avatar asked Aug 03 '13 02:08

tryexceptpass


People also ask

Why can't I cast to my Chromecast from my Android phone?

Troubleshooting steps. Unplug the power cable from the Chromecast device and wait a few seconds, then plug it back in. Wait a couple of minutes. Check if your device now appears on the list of devices you can cast to.


1 Answers

How are you starting your session (which version of startSession() are you using?)

It sounds like you are starting your session ok but then you need to send the url of the video via the MediaProtocolMessageStream.loadMedia().

https://developers.google.com/cast/reference/android/javadoc/reference/com/google/cast/MediaProtocolMessageStream#loadMedia(java.lang.String, com.google.cast.ContentMetadata, boolean)

like image 173
Paul Carff Avatar answered Oct 02 '22 08:10

Paul Carff