Problems with the Google Cast SDK, Custom Receivers, and the YouTube Player API

I’ve been struggling the past couple of days experimenting with the Google Cast SDK in an attempt to create a new mobile app where users can “stumble upon” new YouTube videos and cast them to their televisions using Chromecast. However, I’ve run into a couple of big problems and would like to share what I’ve learned:

  1. The YouTube Player API for mobile apps isn’t compatible with the Google Cast SDK. If you want to show a YouTube video in a mobile app, the YouTube Player API works great. If you want to cast a video from your mobile app to a Chromecast, the Google Cast SDK works great as long as the video is hosted on your own servers. But if you want to cast a YouTube video from your mobile app using the Google Cast SDK + YouTube Player API, you are out of luck!
  2. Chromecast does play nicely however with anything you want to cast from a web browser running on a desktop or laptop computer. I didn’t run into any problems trying to “cast a tab” using YouTube embeds from my desktop or laptop computer.
  3. The last lesson I learned from experimenting with the Google Cast SDK is that Custom Receiver applications don’t seem to work. I’m sure someone out there has been able to get a Custom Receiver to work, but I personally was not. I am assuming that most people who are building apps which are capable of casting video to Chromecasts are using Styled Media Receivers. I did quite a bit of experimentation over the past few days and never ran into trouble using Styled Media Receivers (receiver apps hosted by Google), but I absolutely couldn’t get a Custom Receiver to work at all.

So there you have it! You can’t cast YouTube videos embedded in mobile apps. You can easily cast YouTube videos embedded in websites on desktop and laptop computers. And Custom Receivers for Chromecast don’t work, use Styled Media Receivers instead.

 

topherPedersen