Is it possible to play audio without the audio tag and just using javascript?
I'm injecting script through a tinyMce editor since I don't have access to a site's backend and it doesn't support the audio tag for a client. She just wants a simple sound when you hover over an image. I have it all setup however, the restriction of not having an audio tag is tripping me up.
I am hosting the audio files on a remote site since I cannot upload them here. Is there perhaps a way to leverage that remote site? I've never run into this issue before and can't really find anything on it.
You can use this:
mySound = new Audio('sound.mp3');
mySound.play()
Here is a link to its specification - HTMLAudioElement
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With