I was searching for Javascript/Flash tiny, cross-browser sound player (notifier), but every solution I've met was or too big and feature-full, or based on different libraries (not on Jquery I'm using), or with bugs. The only feature I need is 'play'. :)
For example, http://flash-mp3-player.net/players/js/download/ - this nice little player does not work in Firefox (SetVariable issue).
I'm working on it almost for 3 days and nights. )
Please recommend tiny, cross-browser implementation. Thank you!
play() to Play Audio Files in JavaScript. We can load an audio file in JavaScript simply by creating an audio object instance, i.e. using new Audio() . After an audio file is loaded, we can play it using the . play() function.
The volume property allows us to set the audio volume, as a number between 0 and 1.
To play sound file in the background on a web page, use the <embed>… </embed> element. Also, use the autoplay attribute. This will run music in the background whenever the page loads.
Allow sites to play sound on Chrome Click Privacy and security and then select Site settings. Scroll down to Content and then expand the additional content settings. Scroll down and select Sound. Allow sites to play sound button should be on.
You could use SoundManager 2, allegedly used by last.fm and soundcloud.
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