Search code examples
ioschromecastgoogle-cast

How to cast a youtube video from ios using the iFrame API?


I want to cast a youtube video through my ios device to chromecast. I started by using Google's CastHelloText-ios sample application on github. However, I am having a lot of trouble finding the right documentation for this task.

Does anyone know how I can get started?

EDIT:

I've created some HTML/javascript code to handle the youtube iFrame api stuff. Using the HelloText sender app, I pass in a url to my HTML code. However I noticed that the youtube video starts to play for a while but immediately stops after a few seconds.


Solution

  • Does anyone know how I can get started ?

    You can get started by checking out Integrate Cast v3 into your iOS App since you're using iOS.

    The guide recommends that you try:

    Cast iOS codelab tutorial - Learn step-by-step how to enable an existing iOS video app to use a Google Cast device to cast videos to a TV.

    CastVideos-ios sample app (GitHub) - Run, navigate and view this reference sample app which complies with the UX Guidelines and Design Checklist.

    Not sure if it will help but you may also checkout Embed YouTube Videos in iOS Applications with the YouTube Helper Library