Embedding private youtube video - youtube

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.

Related

How to link a Youtube account to an embedded YTPlayerView player in 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.

Is it possible to add a video on youtube but only display it on your website?

I basically want to make a video "private", but then use some code to display it public on my site. Is that possible?
It seems like "unlisted" is what I want. According to this article:
An unlisted video is a different type of private video. "Unlisted" means that only people who know the link to the video can view it (such as friends or family to whom you send the link). An unlisted video will not appear in any of YouTube's public spaces (such as search results, your channel, or the Browse page). An unlisted video is different to a private video in these ways: you don't need a YouTube account to watch the video (you can see an unlisted video if someone sends you the video's link) there's no 25 person sharing limit
Still not sure if this is really going to help me keep prying eyes away from the video, but for now, it seems to do what I want.

Get streaming URL from any YouTube video

I know about how to play video in device. But Here I just want to know that is it possible to get streaming URL from any YouTube Video? Then how can I do it, I tried to search on google but I can not able to find my solution.
Generally I does not want to play direct stream from video, actually I want to save this URL (stream) in my buffer memory OR whatever temporary file and whenever user click on particular button then particular URL Stream is play.
Al Last I got YouTube APIs + iPhone = Cool mobile apps. But I am not sure that it's helpful in my case or not ? If anybody who worked on this API then please suggest me, Otherwise How can I get streaming URL.
Your suggestion will be appreciated.
Thanks in advance.
http://www.youtube.com/get_video_info?&video_id={VIDEO_ID}
This will not work on all files, some will display the message "This+video+contains+content+from.....". But many will work.
Is it possible to get streaming URL from any YouTube Video? - No, it is not possible without hurting the terms of service of youtube. Google has built the business model of youtube around the advertisements all over youtube, in-video banners and video ads and they want your user to see their ads. This is the reason they completely hide the video stream and would ban your app if you anyway access and stream it directly.
The only consented way to play youtube videos on iOS is to embed it into an iframe of a web view.

How can I link my private videos on YouTube to be played on my website?

How can I link my private videos on YouTube to be played on my website. The point is to bring more viewers to my site by making videos available on my site, yet private on YouTube.
You should set your videos to "unlisted" instead of "private". That
way the video does not show up on your channel or on any search
results but anyone with a link to the video can see it and you can
embed the video on any site.
I didn't try this workaround yet but theoretically it should work, you need to use YouTube API V 3 and follow the below steps:
Set the video's privacy status to unlisted through API.
Embed the video via API in a hidden div.
Use onPlayerStateChange event to check if the video player is currently playing the video, use the API to pause the video at the first second.
If the state changed to "playing" then send an AJAX request to a server side script to revert the the video's privacy status to be private, once you get a confirmation message display the video and use the API to play it.
This should keep the video private even if the user copy & paste the URL in another tab, s/he should get a message that the video is private.
References:
https://developers.google.com/youtube/iframe_api_reference?hl=en
PHP - How to change privacy status of a youtube video through Youtube API v3?

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