I have made a video private https://www.youtube.com/watch?v=mqKtBWC3RrU because i dont want everyone to see those video.
Is there a way to create youtube embed link with the API for private video so that I can share that link to anyone and they can view it using the link.
Related
My iOS app is going to have private and public videos, and users can purchase private ones. Right now I'm using YouTube and the youtube-ios-player-helper library for video hosting. Loading a public video is extremely easy:
playerView.loadWithVideoId("M7lc1UVf-VE")
but how do you do it in the most simplistic way for private videos? Is there something as simple as:
let playerVars = [
"username": username,
"password": password,
]
playerView.loadWithVideoId("M7lc1UVf-VE", playerVars: playerVars)
or something equally as simple?
If you look at the YouTube Embedded Players and Player Parameters API Documentation, you will see that there is no way to pass in a user's credentials.
The only way to play private videos in a web view like the YTPlayerView helper class is to take control of the web view and have the user log into their YouTube account, and then play back the Private video in that specific web view session only. YouTube suggests marking videos as Unlisted rather than Private for playback on mobile devices.
Related discussion can be found in this similar question about the Android player and this Google Groups post.
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.
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.
How do you display private videos from my YouTube channel to my own Website.
Thank you
Instead of setting the video to private, set it to unlisted. It won't appear in any listing on youtube, i.e. your channel, search results & related videos but you can link to it and embed it like a normal video.
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?