I have a question for Web Development | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I have a question for Web Development

Few days ago i have created a website and wanted, when my page is open audio of youtube play automatically. But i am not able to do that. Ifame doesn't support 'autoplay' with new versions of Chrome browse(mobile or pc). But Microsoft edge works perfectly Anyone can suggest me how can i overcome this problem...

7th Nov 2019, 5:38 AM
meherDev
meherDev - avatar
15 Answers
+ 1
Iframe is not supported in html5, so the issue may lie there... internet explorer is so slow in catching up which may be part of the reason why it still reads it... Are you declaring <!Doctype html>
7th Nov 2019, 3:35 PM
Lorecan de Robillard
Lorecan de Robillard - avatar
+ 6
Web browsers were moving towards stricter autoplay policies in order to improve the user experience, minimize incentives to install ad blockers, and reduce data consumption on expensive and/or constrained networks. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes Chrome, Firefox, they are all advancing to protect users; But for Edge.... 🤷‍♂️
7th Nov 2019, 8:58 AM
Gordon
Gordon - avatar
+ 3
# ------------------------ Without Autoplay ------------------------------- <!DOCTYPE html> <html> <body> <iframe width="420" height="345" src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=0"> </iframe> </body> </html> # ------------------------ with autoplay ------------------------------------ <!DOCTYPE html> <html> <body> <iframe width="420" height="345" src="https://www.youtube.com/embed/tgbNymZ7vqY?autoplay=1"> </iframe> </body> </html>
7th Nov 2019, 5:47 AM
onekpsc
+ 1
Bro i knew this trick with ?autoplay=1.. nowadays its not works
7th Nov 2019, 5:50 AM
meherDev
meherDev - avatar
+ 1
Okey lets wait for some other to answer.
7th Nov 2019, 5:53 AM
onekpsc
7th Nov 2019, 10:59 AM
Toni Isotalo
Toni Isotalo - avatar
+ 1
Maybe consider getting rid of the iframe and replacing it with div tags...
9th Nov 2019, 9:27 AM
Lorecan de Robillard
Lorecan de Robillard - avatar
+ 1
uhmm.. Iframe is fully supported and updated in html5 frame tag however is not supported. iframe and frame tags are completely different things.
9th Nov 2019, 4:58 PM
Toni Isotalo
Toni Isotalo - avatar
+ 1
So it turns out that some browsers will only accept the autoplay tag if you also include muted in the tag.
20th Nov 2019, 1:01 PM
Lorecan de Robillard
Lorecan de Robillard - avatar
0
can i go with html4 Lorecan de Robillard
8th Nov 2019, 2:53 PM
meherDev
meherDev - avatar
0
Lorecan de Robillard can i overcome this problem... Plz explain... It is very very important for me
8th Nov 2019, 2:55 PM
meherDev
meherDev - avatar
0
Okay... Thank you so much
9th Nov 2019, 9:39 AM
meherDev
meherDev - avatar
0
Toni Isotalo give me some solutions for this matter
9th Nov 2019, 9:28 PM
meherDev
meherDev - avatar
0
One thing is to add ”?autoplay=1” parameter at the end of the youtube url.
9th Nov 2019, 9:44 PM
Toni Isotalo
Toni Isotalo - avatar
0
I knew this trick, but latest chrome browse is not supporting Toni Isotalo
10th Nov 2019, 5:09 AM
meherDev
meherDev - avatar