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!
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).
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/").
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With