How to link a Youtube account to an embedded YTPlayerView player in iOS? - ios

I have an embedded Youtube player in my iPhone app. I'm using the youtube-ios-player-helper library. What I want to achieve is to authenticate the user and then for the videos he watches using the embedded YTPlayerView player (playing inline) to register on his watched videos history (like if he was using the native Youtube app or the website). I'd appreciate any help as I haven't found how to link a Youtube account to the embedded player using this helper library. Is it possible to achieve?

The YTPlayerView class is just a wrapper around a UIWebView. You will need to load the sign-in page (or load youtube.com have the user click the login link, I think it might be session-specific), and then on a successful log in load the private video you want to play.

Related

Embedding private youtube video

I have a youtube account with some private videos and I want to embed those private videos in my website. Only users who are registered with my website and are logged in to my website should be able to see/play those videos. Also, It is required that they should not be able to open the video using the link in another tab without logging into my website, thus keeping the videos as unlisted is not an option. Any ideas? Thanks in Advance!
It's not possible, when a video is private on YouTube, only you can see the video.
Plus once the video is private you cannot emebed the video.
The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.
https://developers.google.com/youtube/iframe_api_reference
The only solution you have is to not use YouTue service but upload directly the video on your server and use the default HTML5 player. This way you can manage that only connected user can view the videos.

Youtube, vimeo, hulu, vube in UIWebView

Try to create feed which show shared video from youtube, vimeo, hulu and vube.
For this, I create custom view which has thumbnail by default and after user tap thumbnail replaced by UIWebView with url to shared video.
After page loaded, I try to start play video using Media API and method play.
That works good for vimeo, but does not work for youtube, unfortunately i did not check with hulu and vube.
Maybe someone have have workable solution, or some suggestion how that can be done?
The only way to display a youtube video inside your application is by using the YouTube Helper Library, developed by Google, which provides a subclass of UIWebView that you can use.
Here you'll find every information you need.

Open Youtube App and go back to my App

For my project, I would like to watch some Youtube video. However, when I embed Youtube's Player in a UIWebView, the quality is really low. So, I decide to play the videos on the Youtube App if she's on the phone.
My problem is that my user can't go back to my app once the video is finish.
I know there's a URL Scheme for Google Maps App that add a button to go back to your app, but I didn't find anythings for the Youtube App.
Any idea ?
There isn't any public URL Scheme for the YouTube iOS App like Google Maps has for callbacks.
You can use this SDK for embedding Youtube videos into your app: https://developers.google.com/youtube/v3/guides/ios_youtube_helper
Check out the Youtube Developer Site: https://www.youtube.com/yt/dev/hu/api-resources.html, if they will enable an URL Scheme with callbacks, it will be available here.

Is available to embed AdMob in my app that contains my youtube videos?

This is not programing question. I come in here from youtube API page by clicking 'Ask a Question'...;
I will make the app shows yoga videos using Youtube API. Those videos are mine. In that app, people can play my youtube videos. I will show AdMob on video list page. My plan is available?
Or, Except AdMob, I can insert AD onto video?
it is not allowed to simply play YouTube content in an app. This is called framing.

Youtube integration in iOS SDK

How I can integrate Youtube with iOS? Mainly I want to play private videos without asking for login. Login should be hard coded in the app and will not ask user before playing the private video.
Some YouTube videos can be played back in a MPMoviePlayerController - some cannot. When you query a video through the YouTube Data API https://developers.google.com/youtube/2.0/reference#Videos_feed
you'll get back all the content types available for a particular videos, including the Flash player, 3GPP, MP4 (if available), etc. You can use these URLs to load up a MPMoviePlayerController.
This is perfectly fine, but as I've said - not all videos are available to embed this way. Some videos (mainly ones that require adverts to be displayed) can't be put into native controllers.

Resources