最近想做一个通过点击或者mouseover触发 发出声音的效果。
网上很多代码,由于受到播放器组件、浏览器等条件影响,很难找到一个兼容的方法,
ie下很容易实现:
<embed id="realplayer" src="test.mp3" width=328 height=68 type="audio/x-pn-realaudio-plugin" controls="StatusBar,ControlPanel" autostart="flase" loop="true">
<a href="#" onclick="javascript:document.getElementById('realplayer').DoPlay();">Play</a>
<a href="#" onclick="javascript:document.getElementById('realplayer').DoPause();">Pause</a>
以上代码本人已在ie下通过测试,但firefox等浏览器下还没有找到相关方法,有高人指点下吗?为避免不必要的无用功,如果帖代码出来的话,最好是经过自己测试完全可用的,谢谢
真的找了很久,分不是很多,尽量给~~再次多谢各位了,在线等~~