How to display the Private Videos of my YouTube channel - youtube-api

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.

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.

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.

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?

Stop youtube from showing more videos once mine is done

I want to show a video on my company website, but once the video is done, it previews other videos.
How can I stop YouTube from displaying additional videos?
The link addition is only good if I link people to the video...but if they go to the video on their own, they are still subject to the additional videos.
Add:
&rel=0
to your Youtube video URL. Example:
http://youtube.googleapis.com/v/3UBbKLjOK3A?autoplay=1&rel=0

Youtube API - Video is not available

Is there any way to detect if a video was removed or unavailable?
We need to have ability to remove it from the video listing if it has been removed from youtube server.
Hung BUI if you are using youtube API there is a way to filter the video which has been removed or not availble in your locality.
Kindly watch this video and seek it to 2m:03s, The tutor will say how to filter the unavailable and restricted video,..
Youtube Video on YOUTUBE search API
Use a parameter format and restriction along with the youtube api endpoint
https://gdata.youtube.com/feeds/api/videos?q=GoogleDevelopers&max-results=1&v=2.1&alt=jsonc&format=5&restriction=DE
If you hit this endpoint of youtube you can get a set of youtube videos which can be embedded as well as we can check whether the video is restricted in our locality.

Resources