androidchromecastcastcompanionlibrary

Issues adding Chromecast support to Android App


I am attempting to integrate Google Cast into my app. I am using the CastCompanionLibrary. Integrating it is simple. ActionBar is updated with the Cast Icon. I can connect to my Chromecast devices. However, when I attempt to invoke playback, I get one of two results:

  1. VideoCastControllerActivity starts but a spinning Loading icon displays and no video is played on the Chromecast. Only option is to hit the back button.
  2. Only after step 1 above, Attempting to play a video just produces a Toast stating "Faile to load media"

What I can't seem to determine is if this is a problem with the App, if it resides in the content, or if it is a problem with the receiver in Google Cast Dev Console. My content is stored on a MythTV Backend and it can be HLS, MP4, MKV, AVI or 3GPP. I don't get any exceptions in the logs, not in my code or in the CastCompanionLibrary.

Any ideas on how to debug this issue?

Anyone know of a test tool that I can plug a url in to verify if the content will cast correctly on a Chromecast?


Solution

  • I suggest you start with simple MP4 content to first make sure that your app is set up correctly. Once you are able to play mp4, you can move to more sophisticated formats. The media formats that Chromecast supports is listed on our documentation site, so you need to limit your content to that list. The next thing to do to debug your issue, for supported formats, is to make sure that the server that is serving the content provides CORS headers since that is a requirement for almost all (but mp4) content. Finally, if that is satisfied as well, take a look at your receiver logs (turn on logging on the receiver side through the chrome console) and that should give you additional information as to why your content is not playing. To access the receiver logs/console, you need to be running your own custom receiver or your own styled receiver.