+ 2
I found this code from code playground, but it is lacking something, its not working, please help...
3 ответов
+ 6
This code cannot work in mobile environment: autoplay is not enabled without user action (or some JS workarounds tricks)...
Anyway, the JS error displayed at loading is due to the attempt to access a non valid id element in the page (the <iframe> tag is probably expected to be the target, but had been disabled by putting many slashes ^^)...
In desk/laptop environment, assuming you doesn't take care of the (non-blocking) error message and you wait the time of querying and loading the iframe content created through JS, each button will play the expected sound of hidden youtube video loaded in <iframe>s element... However, that's a hudge inneficient way to play sounds in web documents ;P
+ 2
thanks @Visph, but it means in any way it can't be played in mobile?
+ 2
In mobile, it cannot work by this way (embeded youtube videos in <iframe> element)...
But you can play sounds by other ways, if that's your question (since they're not hosted at youtube), even it require more or less tricky JS skills ;)