How can I add simple sound when a message arrives in a web chat session with jQuery?
I noticed that they do it on the chat at http://chat.stackoverflow.com and I want to emulate that in my own software.
jPlayer allows you to do this, and avoid Flash (with the HTML5 <audio>
tag).
Edit:
As drachenstern noted in the comments, SO Chat actually uses jPlayer. Some code from the chat page:
<div id="jplayer" style="position: absolute; top: 0px; left: 0px;">
<embed name="jqjp_flash_0" id="jqjp_flash_0" src=
"http://or.sstatic.net/chat/Jplayer.swf" width="0" height="0" bgcolor="#FFFFFF"
quality="high" flashvars="id=jplayer&fid=jqjp_flash_0&vol=80"
allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage=
"http://www.macromedia.com/go/getflashplayer" />
<div id="jqjp_force_0" style="text-indent: -9999px;">
0.7310569109395146
</div>
</div>
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