'Which changes are required to autostart youtube video in default embed code?
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/
Solution 1:[1]
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>
Solution 2:[2]
Today you'll need to use ?autoplay=1&mute=1 since most browsers have disabled auto starting videos with audio. start=2 is most likely not needed.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Mauricio Arias Olave |
| Solution 2 | havarh |
