Why YouTube embed is not autoplay ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Why YouTube embed is not autoplay ??

<!DOCTYPE html> <!--Shaishab Chandra Shil--> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Hover Button effect</title> <style> iframe { width: 100%; border-radius: 5px; box-sizing: border-box; border: 2px solid #6E7AFF; } </style> </head> <body> <iframe id="x" src="https:/www.youtube.com/embed/jZxqT3164eg" allowfullscreen frameborder="0">https:/www.youtube.com/embed/jZxqT3164eg</iframe> </body> </html>

10th Feb 2022, 7:11 AM
Shai Shab
Shai Shab - avatar
2 Answers
+ 2
full code will be - <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Hover Button effect</title> <style> iframe { width: 100%; border-radius: 5px; box-sizing: border-box; border: 2px solid #6E7AFF; } </style> </head> <body> <iframe id="x" src="https://www.youtube.com/embed/jZxqT3164eg?autoplay=1&mute=1""></iframe> </body> </html>
10th Feb 2022, 8:40 AM
Shaurya Kushwaha
0
here you have to put //(double front slash) after https: to make it work and ?autoplay=1&mute=1 after the link to autoplay. The below code will work it will be - <iframe id="x" src="https://www.youtube.com/embed/jZxqT3164eg?autoplay=1&mute=1"></iframe>
10th Feb 2022, 7:25 AM
Shaurya Kushwaha