How can I autoplay a video using the new embed code style for Youtube?
Just put "?autoplay=1" in the url the video will autoload.
So your url would be:
http://www.youtube.com/embed/JW5meKfy3fY?autoplay=1
In case you wanna disable autoplay, just make 1
to 0
as
?autoplay=0
Actually, you will have to use the "?" instead of "&" for your first parameter only. If you use more than one parameter, you will then have to add "&" to the chain.
For instance, if you want to add autoplay and closed captioning, you will have to add this portion to your embedded video URL: ?autoplay=1&cc_load_policy=1.
It would look like this:
<iframe width="420" height="315" src="http://www.youtube.com/embed/
oHg5SJYRHA0?autoplay=1&cc_load_policy=1" frameborder="0"
allowfullscreen></iframe>
You need to add an extra parameter, alongside the autoplay=1
allow="autoplay"
making it:
<iframe src="your-video-url?rel=0&controls=0&showinfo=0&autoplay=1" frameborder="0" allow="autoplay; encrypted-media"></iframe>