Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed youtube videos that play in fullscreen automatically

So what I'm trying to do is have fullscreen video across my website. But I would like to auto play a youtube video and automatically in fullscreen (The size of the browser window). My site navigation is left and right arrows that slide from page to page. Then up and down arrows that scroll up and down each page.

But the only thing I'm trying to get done is autoplay a youtube video in fullscreen, again, the size of the browser window. Or am I going to have to host the video myself? Which may be easier, but will take up bandwidth that I'll have to pay for. Anyway thank you in advance for your help, cheers!

like image 299
user2878169 Avatar asked Mar 15 '14 21:03

user2878169


People also ask

How do you make YouTube videos full screen automatically?

Click on your username at the top right and choose YouTube Settings. Make sure its YouTube settings and not just the regular settings for your Google account. In the settings, click on Playback from the left sidebar. Here, check the box in front of Always play HD on full-screen (when available).

Can I embed a YouTube video and auto play?

To make an embedded video autoplay, add "&autoplay=1" to the video's embed code right after the video ID (the series of letters that follows "embed/").

How do I autoplay a video in iframe?

Allowing iframes to autoplay video content You should also note the need to use the allowfullscreen attribute in complement to the allow attribute in order to support browsers that do not support allow attribute. If you are using amp-iframe and autoplay you need to add allow="autoplay" to your amp-iframe element.


1 Answers

This was pretty well answered over here: How to make a YouTube embedded video a full page width one?

If you add '?rel=0&autoplay=1' to the end of the url in the embed code (like this)

<iframe id="video" src="//www.youtube.com/embed/5iiPC-VGFLU?rel=0&autoplay=1" frameborder="0" allowfullscreen></iframe>

of the video it should play on load. Here's a demo over at jsfiddle.

like image 197
John Karasinski Avatar answered Oct 13 '22 16:10

John Karasinski