Help me on this audio tag, it's not playing.... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help me on this audio tag, it's not playing....

https://code.sololearn.com/W9OsxW6Sbm4K/?ref=app

22nd Jan 2019, 8:40 AM
Chimkaeme Ndu
Chimkaeme Ndu - avatar
6 Answers
+ 4
http://66.90.93.122/ost/who-wants-to-be-a-millionaire/zhlvbljg/Chi%20Vuol%20Essere%20Milionario%20%2800%29.mp3 You are linking to a webpage instead of the real mp3 file Change to use the above location https://code.sololearn.com/WMFpBhXpiDGM/?ref=app
22nd Jan 2019, 1:59 PM
Gordon
Gordon - avatar
+ 2
autoplay is blocked by modern browser to protect user from malicious acts. The protection is called user gesture and you'll need to use JavaScript to set the trigger of playing sound with a mouse event.
22nd Jan 2019, 10:19 AM
Gordon
Gordon - avatar
+ 2
No, user gesture is a must.
22nd Jan 2019, 10:26 PM
Gordon
Gordon - avatar
+ 2
I have added JS to the demo for you, it play the music once when user click anywhere on screen. That's the closest to autoplay on modern browsers
22nd Jan 2019, 10:43 PM
Gordon
Gordon - avatar
0
It's nt even a matter of autoplay it's nt even playing even without dat autoplay.
22nd Jan 2019, 1:53 PM
Chimkaeme Ndu
Chimkaeme Ndu - avatar
0
Tnx...alot!!!! but isn't there a way to make it play once the window loads?
22nd Jan 2019, 8:52 PM
Chimkaeme Ndu
Chimkaeme Ndu - avatar