Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autoplay with <iframe> You Tube video - ?autoplay=1 not working

How can I autoplay a video using the new embed code style for Youtube?

My code followed these instructions and does not work. I also looked on the YouTube help and they say the same thing -- does not work for me.

<html><body>
<iframe width="640" height="385" src="//www.youtube.com/embed/0319ZgKMLzw?autoplay" frameborder="0" allowfullscreen></iframe></body>
</html>

See it not autoplaying here, the code is there in firebug.

like image 814
user2757556 Avatar asked Sep 07 '13 18:09

user2757556


People also ask

Why is my YouTube autoplay not working?

AutoPlay may not work on YouTube due to corrupt cache/data of the browser or corrupt installation of the YouTube mobile application. Moreover, an outdated browser or misconfiguration of your browser like DRM settings, etc. may also cause the error under discussion.

How do I autoplay a YouTube video in iframe?

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 enable autoplay in iframe?

You need to add &muted=1 to the iFrame src path and add attribute allow="autoplay" to the iFrame. Now the video starts automatically in Chrome.

Can YouTube videos can be embedded using an iframe?

Select content to play. You can configure your embedded player to load a video, a playlist, or a user's uploaded videos. For an IFrame embed, the YouTube video ID for the video that you want to load is specified in the IFrame's src URL.


1 Answers

Edit your embed code to "?autoplay=1" and add "http://". Here is the working code for you...

<iframe width="640" height="385" src="http://www.youtube.com/embed/0319ZgKMLzw?autoplay=1"> </iframe>    
like image 94
Gencay Deniz Avatar answered Oct 21 '22 00:10

Gencay Deniz