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

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.

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

Related

Video unavailable. Watch on Youtube problem

I have a problem about Youtube iOS SDK (youtube-ios-player-helper). I am able to use it in my iOS native code now and it's working fine.
The problem is there are some videos which unable to watch on the application. The video iframe shows this:
Youtube video problem
Can anyone find any ways to pass through it? Or maybe is there any parameters for the search API which filter those kinds of video out of my results?
My search API is https://www.googleapis.com/youtube/v3/search?part=snippet&q=Mật vụ bóng đêm&maxResults=50&type=video with region VN.
Thanks a lot for your help.

iOS Swift 4: Uploading Videos to YouTube

I am trying to implement a feature where users can upload a video to YouTube directly from the app, sort of like a share to Twitter or Facebook type way. I don't want to use the UIShareViewController, I want to allow it to be upload-able with the touch of one button.
I have done some research, and all the other posts are outdated, mostly in 2014. I am looking for a new version using Swift 4. I understand the whole process of registering my app through Google to get the API, I have looked at their documents. However, their section on uploading videos requires Python 2.5 or higher, so I am not sure where to go about it.
This is a link to their API:
https://developers.google.com/youtube/v3/guides/uploading_a_video
I found these questions, but they are outdated.
Upload Video to YouTube in Swift
Are there any updated resources online that can help me?
A brief description of the process after registering the app with the Api would help.

How does whatsapp play youtube videos directly in iOS App?

So since the recent update in whatsapp, you can play youtube videos using the default AVPlayer in iOS.
I wanted to know how is this functionality possible? And if there is a way to implement this without violating Youtube's Terms of Service?
I know of tools like https://github.com/0xced/XCDYouTubeKit but they clearly violate Youtube's TOS.
Check the screenshot below
One option that I don't know if the guys on Whatsapp use but I already used in a production App is a Pod made by YouTube guys, called
YouTube-Player-iOS-Helper
You can see the link to the documentation below. With this Pod you can put a video preview in a UIView that helps but I don't know if is the best option to use because the Pod uses a Webview, injecting Javascript.
It's just an option... maybe there is a better solution for this problem.
Documentation link: https://developers.google.com/youtube/v3/guides/ios_youtube_helper
I think Youtube API should available to integrate in your iOS app. Because normally in website youtube provide embedded api to play their video on other website. So, same for iOS also may be possible. Please check youtube's official developer website. You can Check this: https://developers.google.com/youtube/v3/guides/ios_youtube_helper

Chromecast support for youtube videos played via the youtube player API

When I watch videos in the official youtube app on my Android device, I see the familiar cast icon in the toolbar, which sends the playing video to my chromecast.
I want to write my own app that uses the official youtube player API for Android. Playing with the Android samples (https://developers.google.com/youtube/android/player/sample-applications), I've noticed that the chromecast icon is missing.
What is the best way to add chromecast support to my app which uses YoutubePlayerView or YoutubePlayerFragment to play videos?
Well, if you want to use chromecast for the YouTube API, then you can start by knowing how to integrate Cast in an Android App. You will learn here the basic information that you need to know. Also, check this YouTube Android Player API to know how it is works.
I found here a demo that shows how to integrate YouTube APIs with Chromecast. It is designed for developers who are learning about the Chromecast SDK or YouTube APIs, or for those wishing to run a code lab on various Google technologies.

Play a Youtube Video using its Api

Im trying to play a youtube video using its api but im stuck i already set the api in xcode using this tutorial https://www.youtube.com/watch?v=q7m3qCsQBEE but i don´t know what to do next, google documentation is really confusing and makes it difficult to understand a simple service like the one i need any help?
I know how to embed a youtube video in a uiWebView but this no longer works for me i need to implement the api call.

Resources