1
votes

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/

1

1 Answers

0
votes

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>