Automaticly embed recent YouTube video with Channel ID - youtube

This working:
<iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=VanossGaming" frameborder="0" allowfullscreen></iframe>
But for CHANNEL ID don't work.
This one don't work:
<iframe width="300" height="200" src="http://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=UCKqH_9mk1waLgBiL2vT5b9g" frameborder="0" allowfullscreen></iframe>
So how to use this Iframe for CHANNEL ID.
Thanks for all answers..

Related

Which changes are required to autostart youtube video in default embed code?

What changes are required in youtube default embed code to let videos auto start on the web pages on-load?
https://www.youtube.com/embed/ngM_8pqGjmA?autoplay=1
<div width="100%" align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/ngM_8pqGjmA?autoplay=1" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>
Output is normal, embedded but not auto starting. Video is embedded here on Google sites based website https://www.ibpspoexam.com/
Today you'll need to use ?autoplay=1&mute=1 since most browsers have disabled auto starting videos with audio. start=2 is most likely not needed.
That video is set to start parameter at 0:02 as follows:
https://www.youtube.com/embed/ngM_8pqGjmA?autoplay=1;start=2
By adding the start paarmeter in your code, the video will autoplay.
Here is the code - with the start parameter added:
<div width="100%" align="center"><iframe width="560" height="315" src="https://www.youtube.com/embed/ngM_8pqGjmA?autoplay=1;start=2" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></div>

YouTube Autoplay Issue

I am trying to get an embedded YouTube video to autoplay. I have set the ?autoplay=1 in the parameter but this seems to be deprecated. I have not been able to find any documentation on it though.
How can I get autoplay to work on videos?
<iframe class="iframe-vid" width="560" height="315" src="https://www.youtube.com/embed/Bey4XXJAqS8?autoplay=1&enablejsapi=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
If you don't mind that the video autoplays muted, you can add the following parameter in the YouTube URL:
&rel=0&mute=1
Here is the iframe with autoplay enabled and muted1
<iframe class="iframe-vid" width="560" height="315" src="https://www.youtube.com/embed/Bey4XXJAqS8?autoplay=1&enablejsapi=1&rel=0&mute=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen=""></iframe>
Test made in Google Chrome Version 72.0.3626.119 (Build oficial) (32 bits)
1 I really don't know why the "mute" option must be set in the URL (and only in Google Chrome), because in Firefox and Edge the video autoplays without adding the mute parameter.
In order for the autoplay=1 to work, you must put the single quotation mark after the "1" and a space. Works perfect after.
ex. autoplay=1"

allowfullscreen is not working on frameset

I have an old service working on frameset-frame (I know it's deprecated but I have no choice) and users can add youtube iframe tags.
but from some point the fullscreen action is not working anymore(it used to work).
There's allowfullscreen attribute added already.
<iframe width="560" height="315" src="https://www.youtube.com/embed/Ea9pOiwzd0c" frameborder="0" allowfullscreen></iframe>
I tried allowfullscreen on frameset and frame tag also.
I have tried like
allowfullscreen
allowfullscreen="true"
allowfullscreen="allowfullscreen"
mozallowfullscreen="mozallowfullscreen"
msallowfullscreen="msallowfullscreen"
oallowfullscreen="oallowfullscreen"
webkitallowfullscreen="webkitallowfullscreen"
... everything I can find on web but nothing worked for me.
You can try
allowfullscreen=true

embed a YouTube video in an XPages repeat control

I'm looking to embed a YouTube video into an XPage, probably into a repeat control. I've looked around but can't find anything specific to XPages. I can create a link to open the YouTube video but that just moves them to YouTube but I don't want to leave my site.
Does someone have an example of how to do this.
Use the HTML <iframe>, <object> or <embed> tag to insert YouTube videos into your XPage repeat control.
Example:
<xp:repeat
id="repeat1"
rows="30"
var="video"
indexVar="number">
<xp:this.value><![CDATA[#{javascript:
[ "http://www.youtube.com/embed/XMoTb1iep48",
"http://www.youtube.com/embed/lvs3vpmEKHg",
"http://www.youtube.com/embed/63lYaeOJZOA",
"http://www.youtube.com/embed/6D6PzLSlEsQ"
]
}]]></xp:this.value>
<iframe
width="400"
height="250"
style="margin:2em"
src="#{video}"
frameborder="0"
allowfullscreen="allowfullscreen">
</iframe>
<xp:text
rendered="#{javascript:(number + 1) % 2 == 0}">
<br />
</xp:text>
</xp:repeat>
Make sure you use http://www.youtube.com/embed/YOUR_VIDEO_ID as URL.
A detailed description you can find here.
You need to follow instructions and put a short snippet anywhere in the XPage. Something like:
<iframe title="YouTube video player" class="youtube-player" type="text/html"
width="640" height="390" src="http://www.youtube.com/embed/-X2zNe3YFNM"
frameborder="0" allowFullScreen></iframe>
With too many rows in your repeat you can expect lots of iframe reloads on every refresh.

Rails: Take embed code and get video URL

is there a rails library for taking embed code and returning the url of the video?
for example, if I pass the following:
<iframe width="420" height="315" src="//www.youtube.com/embed/J---aiyznGQ" frameborder="0" allowfullscreen></iframe>
it will return
www.youtube.com/embed/J---aiyznGQ
You can get the video id using a regular expression and then use that to generate the url.
Here is a good link for the regex: https://gist.github.com/afeld/1254889
Consider the following:
embed_code = '<iframe width="420" height="315" src="//www.youtube.com/embed/J---aiyznGQ" frameborder="0" allowfullscreen></iframe>'
regex = /(youtu\.be\/|youtube\.com\/(watch\?(.*&)?v=|(embed|v)\/))([^\?&"'>]+)/
youtube_id = embed_code.match(regex)[5]
'www.youtube.com/embed/' + youtube_id
#=> www.youtube.com/embed/J---aiyznGQ

Resources