How to play VEVO Content using YouTube iframe API? - youtube-api

I need to play VEVO videos on an HTML5 player which is created using YouTube's API in iOS.
https://developers.google.com/youtube/iframe_api_reference
Currently I'm able to play normal videos with out a glitch.But when ever i try to play a VEVO video,It says "The content cant be played outside of YouTube".Is there any legal way of going about this?.
I have already tried to set the "origin" property of the player to my domain.This did not help.
This is an Example from the above link where the origin is set
<iframe id="player" type="text/html" width="640" height="390"
src="http://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http://example.com"
frameborder="0"></iframe>
If anyone knows of any other way to legally play VEVO content please let me know. :).Any legal loopholes will also do :D.

I have played some vevo videos just by placing the ID.
Sometimes vevo videos have certain restractions for embedding like for example, the country from the user is fetching the video.

Related

Embedded YouTube Video won't play with ?autoplay=1

Any thoughts on why the embedded YouTube video won't autoplay on this site?
https://quantumleapin.wpengine.com/
As far as I can tell the autoplay is integrated correctly…
Your src attribute is not formatted correctly, it reads :
https://www.youtube.com/embed/T8u41Uy7wNw?rel=0&showinfo=0?ecver=1?autoplay=1
It should be :
https://www.youtube.com/embed/T8u41Uy7wNw?rel=0&showinfo=0&ecver=1&autoplay=1
Same thing was happening to me and I copied the embed code exactly from YouTube and it included that ?ecver=1 which was making it not play. Once I removed ?ecver=1 it was ok.

YouTube Live Streaming embed code keeps changing

I do live streaming with YouTube and I can watch it on my site by coping the embed code into my site
Its looks like this below
<iframe width="640" height="360" src="https://www.youtube.com/embed/gz54fede3Y" frameborder="0" allowfullscreen></iframe>
But recently I discovered that every time I do a live stream, I have to start updating the embeded code on my site each time with the one that will be generated from my live channel.
This is because it keeps regenerating a different code. Its so frustrating to do this, is there a way to get a particular embed code that will not change so I don't have to worry about this, or is there a setting that I am not aware of.
There is a static URL to embed the video player for the "Stream now" stream. It is currently not exposed anywhere in the UI, but we will fix that soon (hopefully.)
It looks like this: https://www.youtube.com/embed/live_stream?channel=[channel ID]
You can also use a YouTube Gaming link, like so: https://gaming.youtube.com/embed/live_stream?channel=[channel ID]
You can determine your channel ID by going to https://www.youtube.com/account_advanced and copying the string after "YouTube Channel ID".
Once you've got this link, you can use it in the "src" attribute of your embed code.

Video Code: Mute and Autoplay

How do i mute a Youtube Video with in my iframe block without using JS? Is it a way which can be leveraged?
-I do not want to consume Youtube API. Is there any way that videos can be muted with just API parameters?
I think it is not possible if you are only using the YouTube API parameter.
If you check the supported parameter of the IFrame Player API, you will not see any parameter here that can mute the video.
So the only way to mute video is the player.mute():Void.
Here is the jsfiddle for the sample code.
For more information, check this related threads:
How do I automatically play a Youtube video (IFrame API) muted?
How to Embed a YouTube Video with Sound Muted
use &mute=1
example : <iframe src="https://www.youtube.com/embed/UNIQUE-VIDEO-ID?&autoplay=1 &mute=1&rel=0&controls=0"></iframe>

Get the video tag of youtube embed videos

I'm trying to change the playback rate of an embed youtube video, is there any way to get the video tag?
I know that the video is held in an iframe, could a chrome extension be used to bypass the security?
Any help appreciated :)
YouTube API creates a public JavaScript object that allows you to control the YouTube video. By default the object is called player.
The only problem is if the developer assigned it to another object.
I guess what you need is not to bypass the iframe, you just need to detect the name of that object.
If you're using the HTML5 YouTube player:
document.getElementsByTagName("video")[0]

Embedded YouTube Videos - Removing Videos at End

At the end of a YouTube video you will see other videos that you can choose to watch if you choose. I am embedding a YouTube video on my site and would prefer that those videos did not show at the end of the video. Is there a way to remove those videos and have just a reply option (or something similar). According to this question you can remove the annotations from YouTube Videos that are embedded on your site and that made me wonder if the same can be achieved for end of video videos.
Yes that is possible, use this script:
<iframe width="560" height="315" src="http://www.youtube.com/embed/{link}?rel=0" frameborder="0" allowfullscreen></iframe>
The important part is the ?rel=0.
The functionality of this changed on Sept. 25th 2018.
The behavior for the rel parameter is changing on or after September 25, 2018. The effect of the change is that you will not be able to disable related videos. However, you will have the option of specifying that the related videos shown in the player should be from the same channel as the video that was just played.
https://developers.google.com/youtube/player_parameters?csw=1#release_notes_08_23_2018

Resources