javascript 调用MediaPlayer实现多曲音乐的播放
如何在网页上实现调用MediaPlayer实现多曲音乐的播放。有很多种方法。我只会一种方法也是最喜欢的一种方法是用javascript。
还是用代码说话...
HEAD标签内加的:
<script type="text/javascript"> var temp=0; function play(){ var play = document.getElementById("paly") if(temp==1) { str="http://listen.idj.126.net/uf/496/8296f194bd164be5ba820b2ddbba6cff.mp3"; } else if(temp==2) { str="http://p.dootnet.com/23/588/63894/04054576.wma"; } else if(temp==3) { str="http://h.5q68.com/music/57.MP3"; } play.setAttribute("URL",str); } function play2() { temp++; if(temp>3) { temp=1; } play(); } </script>
BOOY标签内的内容:
<object id="paly" width=450 height=150 classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"> <param name="URL" > <param name="rate" value="1"> <param name="balance" value="0"> <param name="currentPosition" value="0"> <param name="defaultFrame" value=""> <param name="playCount" value="1000"> <param name="autoStart" value="1"> <param name="currentMarker" value="0"> <param name="invokeURLs" value="-1"> <param name="baseURL" value=""> <param name="volume" value="50"> <param name="mute" value="0"> <param name="uiMode" value="full"> <param name="stretchToFit" value="0"> <param name="windowlessVideo" value="0"> <param name="enabled" value="-1"> <param name="enablecontextMenu" value="-1"> <param name="fullScreen" value="0"> <param name="SAMIStyle" value=""> <param name="SAMILang" value=""> <param name="SAMIFilename" value=""> <param name="captioningID" value=""> </object> <input type="button" name="button" id="button" value="按钮" onClick="play2();">
相关推荐
nmgxzm00 2020-11-10
ifconfig 2020-10-14
hhanbj 2020-11-17
zfszhangyuan 2020-11-16
古叶峰 2020-11-16
一个智障 2020-11-15
jipengx 2020-11-12
81427005 2020-11-11
xixixi 2020-11-11
游走的豚鼠君 2020-11-10
苗疆三刀的随手记 2020-11-10
Web卓不凡 2020-11-03
小飞侠V 2020-11-02
帕尼尼 2020-10-30
爱读书的旅行者 2020-10-26
帕尼尼 2020-10-23
杏仁技术站 2020-10-23
淼寒儿 2020-10-22