Play a Youtube Video using its Api - ios

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.

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.

What is YouTube's NEW Live Stream permanent url?

I was using this url to embed our livestream in our website
https://www.youtube.com/embed/live_stream?channel=CHANNEL_ID
Unfortunately it's not working anymore, I think it has been deprecated by YouTube :(
Any idea what is the alternative?
I want to avoid using the YouTube search API due to it's limitations, and the fact that the broadcast has to start so the API can find it.
Also I don't want to keep updating the url YouTube creates every time I start a stream...
Please 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

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.
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

how to ensure that a youtube API response only contains videos that are suitable for playback on a mobile device

I am trying to add some youtube videos from my Admin page to database. So that mobile application can make use of them to play.
I want to filter the result from YouTube API link so that i can make sure that whatever videos i add to the database will be able to play on mobile devices like IOS and Android.
I tried
&format=5 and &format=1
but no use.
I also went through Youtube API v2.0 Docs but unable to find the correct way to assign fields parameter to my query string
can anyone guide me to fix this?
What you need is videoEmbeddable and videoSyndicated.
Here's my answer to original question: retrive only mobile-supported video from YouTube API

Resources