日期:2014-05-16  浏览次数:20383 次

javascript 连续播放3个音频文件
我想通过onclick或其他事件,来顺序播放3个音频文件,该如何做?
请各位大侠给与指点,附上代码加倍送分

------解决方案--------------------
如果播放的是mp3,可以放到m3u文件里面,然后播放m3u文件即可
------解决方案--------------------
<object id= "player " classid= "CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 "
type= "application/x-oleobject " width= "0 " height= "0 "
style= "position:relative;left:0px;top:0px;width:0px;height:0px; ">
<param name= "FileName " value= "http://new.yuedui.com/bbbbbbwwyyy888/2006/0701/0010/4.wma ">
<param name= "autoStart " value= "true ">
<param name= "balance " value= "0 ">
<param name= "currentPosition " value= "0 ">
<param name= "currentMarker " value= "0 ">
<param name= "enableContextMenu " value= "false ">
<param name= "enableErrorDialogs " value= "false ">
<param name= "enabled " value= "true ">
<param name= "fullScreen " value= "false ">
<param name= "invokeURLs " value= "false ">
<param name= "mute " value= "false ">
<param name= "playCount " value= "1 ">
<param name= "rate " value= "1 ">
<param name= "uiMode " value= "none ">
<param name= "volume " value= "100 ">
</object>
用JS对其中的FileName重新赋值就可以了
------解决方案--------------------
关键是怎么控制什么时候赋值,楼上的。

我记得可以写一个文本文件,里面分别以一定格式写上三个地址,然后重命名为wma
------解决方案--------------------
<OBJECT id= "Player " .......

function Tab(){
if(Player.playState == 1) Next_One();
setTimeout( "Tab() ", 1000);
}

Next_One()控制修改地址并播放下一首。
Player.URL= "http://..... ";
Player.controls.play();
Tab();

记得刚开始要触发tab()函数