曲阿论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2108|回复: 2

专辑播放器01代码实例

[复制链接]
发表于 2011-12-3 08:13:33 | 显示全部楼层 |阅读模式 来自 中国江苏镇江
  1. <html><head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  3. <title>:: 梦回云阳音乐播放器 ::</title>

  4. <STYLE>BODY {
  5. SCROLLBAR-FACE-COLOR: #FFFFFF; FONT-SIZE: 9pt; SCROLLBAR-HIGHLIGHT-COLOR: #FFFFFF; SCROLLBAR-SHADOW-COLOR: #FFFFFF; SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;

  6. SCROLLBAR-ARROW-COLOR: #000000; SCROLLBAR-TRACK-COLOR: #FFFFFF; FONT-FAMILY: dadum10; SCROLLBAR-DARKSHADOW-COLOR: #FFFFFF
  7. }
  8. TD {
  9. FONT-SIZE: 9pt; COLOR: #000000; LINE-HEIGHT: 180%; FONT-FAMILY: 宋体
  10. }
  11. DIV {
  12. FONT-SIZE: 9pt
  13. }
  14. INPUT {
  15. HEIGHT: 16px
  16. }
  17. .syes {
  18. BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #ffffff; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #ffffff;

  19. WIDTH: 77px; CURSOR: hand; COLOR: #ffffff; BORDER-TOP-COLOR: #ffffff; HEIGHT: 17px; BACKGROUND-COLOR: #daebda; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR:

  20. #ffffff
  21. }
  22. </STYLE>

  23. <SCRIPT Language="Javascript">
  24. var url_str="前世今生 Previous And Present Life=http://storage.live.com/items/B5849A8C3C39F646%21399?3Ffilename%3D/01.mp3|在云端 Beyond The Clouds=http://storage.live.com/items/B5849A8C3C39F646%21400?3Ffilename%3D/02.mp3|流动的影 Flowing Shadow=http://storage.live.com/items/B5849A8C3C39F646%21401?3Ffilename%3D/03.mp3|新生 New Blood~To My Coming Child=http://storage.live.com/items/B5849A8C3C39F646%21402?3Ffilename%3D/04.mp3|无极 Infinite=http://storage.live.com/items/B5849A8C3C39F646%21403?3Ffilename%3D/05.mp3|求索 Way Of Seeking=http://storage.live.com/items/B5849A8C3C39F646%21404?3Ffilename%3D/06.mp3|听潮 Listening To Tide=http://storage.live.com/items/B5849A8C3C39F646%21405?3Ffilename%3D/07.mp3|色 Substance Desire & Spirit=http://storage.live.com/items/B5849A8C3C39F646%21406?3Ffilename%3D/08.mp3|太极 Taichi=http://storage.live.com/items/B5849A8C3C39F646%21407?3Ffilename%3D/09.mp3|风之语 Whisper Of The Wind=http://storage.live.com/items/B5849A8C3C39F646%21408?3Ffilename%3D/10.mp3";
  25. var je="=";
  26. var url="|";
  27. var subject_arr = new Array();var url_arr = new Array();var sel_arr = new Array();
  28. var inx=0, old_inx=0;var now_song=0;var max_count=0;var tm=null;var tm_cnt=0;var err_stat=false;
  29. function p_play(){tm_cnt++;if((SyesPlayer.filename==url_arr[inx])&&(!err_stat)) {
  30. SyesPlayer.play();clearTimeout(tm);tm=null;tm_cnt=0;}
  31. if(tm_cnt==4){clearTimeout(tm);tm=null;tm_cnt=0;}}
  32. function one_play(i){if(tm != null) clearTimeout(tm);old_inx=inx;
  33. inx=i;SyesPlayer.filename=url_arr[i];tm_cnt=0;err_stat=false;tm=setTimeout("p_play()",1000);
  34. stat.innerHTML="<marquee bgcolor=000000 scrollamount=1 width=220><font color=FFFF00> "+subject_arr[i]+" 更多音乐分享请访问韭菜的博客 www.yy708090.com "+"</font></marquee>";
  35. eval('m'+old_inx).style.color='';eval('m'+inx).style.color='0000FF';}
  36. function onlistover(src){src.style.color="green"}function onlistout(src){src.style.color=""}
  37. function syes_next(){if(now_song<(max_count-1)) now_song++;else now_song=0;one_play(sel_arr[now_song]);}
  38. function listen_check(){
  39. var songlist = ""
  40. var chk = false
  41. var i, url;
  42. for(i=0; i<document.list_form.elements.length; i++) {
  43. var e=document.list_form.elements[i];
  44. if(e.name == 'chk') {
  45. if(e.checked == true) {
  46. chk = true;
  47. songlist = songlist + e.value + ",";}}}
  48. if(chk == true ){
  49. sel_arr=songlist.split(',');
  50. now_song=0;
  51. max_count=sel_arr.length-1;
  52. one_play(sel_arr[now_song]);
  53. }else{
  54. max_count=0;
  55. alert("选定歌曲");}}
  56. function all_check(){
  57. var i;
  58. for(i=0; i<document.list_form.elements.length; i++) {
  59. var e=document.list_form.elements[i];
  60. if(e.name == 'chk') {
  61. if(e.checked != true)e.checked = true;}}}
  62. function one_check(k){
  63. var i;
  64. for(i=0; i<document.list_form.elements.length; i++) {
  65. var e=document.list_form.elements[i];
  66. if((e.name == 'chk')&&(e.value == k)) {
  67. e.checked = true;break;}}}
  68. function un_check(){var i;
  69. for(i=0; i<document.list_form.elements.length; i++) {
  70. var e=document.list_form.elements[i];
  71. if(e.name == 'chk') {
  72. if(e.checked == true) e.checked = false}}}
  73. function set_list(){
  74. var i, cnt, str;
  75. cnt=url_str.split(url).length;
  76. str="<form name=list_form><table>";
  77. for(i=0;i<cnt;i++){
  78. subject_arr[i]=(i+1)+'. '+url_str.split(url)[i].split(je)[0];
  79. url_arr[i]=url_str.split(url)[i].split(je)[1];
  80. str+=" <tr id=m"+i+">"+"<td><input type=checkbox onfocus='this.blur()' name='chk' value="+i+"></td><td><span style=cursor:hand onmouseover='onlistover(this)' onmouseout='onlistout(this)' onclick='one_play("+i+")'>";
  81. str+=subject_arr[i]+'</span>';}+"</td></tr></table></form>";document.all["list_tbl"].innerHTML=str;}
  82. var trackPositionSts;var positionSet = false;
  83. var varlength=500;var varstartpoint=54;
  84. function SyesPlayerSetPosition() {
  85. if(positionSet == true) {antiauto=30;
  86. positionSet=false;dragapproved = false;
  87. per = (document.all["position"].style.pixelLeft - varstartpoint)/varlength;
  88. psit = Math.floor(document.all.SyesPlayer.Duration * per);
  89. setPosition(psit)}}
  90. function TrackPosition() {
  91. positionSet = true;iex = event.clientX;iey = event.clientY;
  92. tempx = document.all.position.style.pixelLeft;
  93. tempy = document.all.position.style.pixelTop;
  94. dragapproved=true;
  95. document.onmousemove=positionDragControl;
  96. if(document.all) document.onmouseup = SyesPlayerSetPosition}
  97. function positionDragControl(){
  98. if(dragapproved == true){
  99. var mov = tempx + event.clientX - iex;
  100. if(mov >= varstartpoint && mov <= varstartpoint+varlength)
  101. {document.all["position"].style.pixelLeft = tempx + event.clientX - iex}return false}}
  102. function setPosition(psit){document.all.SyesPlayer.CurrentPosition = psit}
  103. function setTrackIcon() {
  104. if(positionSet == false){
  105. var nowposition = Math.floor(document.all["SyesPlayer"].CurrentPosition);
  106. var totalposition = Math.floor(document.all.SyesPlayer.Duration);
  107. if (nowposition > 0){
  108. document.all["position"].style.pixelLeft = varstartpoint + (varlength * (nowposition / totalposition));}}}
  109. function muinit(){trackPositionSts = setInterval('setTrackIcon()',400)}
  110. </SCRIPT>
  111. </head>

  112. <body onLoad="muinit();" leftmargin=0 topmargin=10 bgcolor="" text="black" link="000000" vlink="000000" alink="red">
  113. <STYLE>body{CURSOR:url(020.ani); }</STYLE>
  114. <table border=1 cellpadding="14" cellspacing="3" style="filter:progid:DXImageTransform.Microsoft.Shadow(color:silver,direction:150,strength:10)"><tr><td><table border=2 cellspacing="2" cellpadding=0 bordercolor=#ffffff> <td bgcolor=#ffffff>
  115. <div style=margin-left:130;>
  116. <STYLE ID="First" TYPE="text/css">
  117. #ShowText {display:none}
  118. #HideText {color:#0000000; cursor:hand;}
  119. .DIV1 {display:none}
  120. </STYLE>
  121. <STYLE ID="Second" TYPE="text/css" DISABLED>
  122. #HideText {display:none}
  123. #ShowText {color:RED; cursor:hand;}
  124. </STYLE>
  125. </DIV><TABLE cellpadding="0" cellspacing="0" border="0" width="403">
  126. <TR>
  127. <TD align="left" height="72"><div style=margin-left:50;margin-top:20;margin-bottom:20;>
  128. <img onclick='all_check()' src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102056zovwxeehhwhiehim.jpg" onmouseover="this.style.filter=' alpha( opacity=100)'" style="FILTER: gray alpha( opacity=70); CURSOR: hand" onmouseout="this.style.filter=' gray alpha( opacity=70)'" border=0 title="全选"><img onclick='un_check()' src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102056xo8n2x9nja8cx19w.jpg" onmouseover="this.style.filter=' alpha( opacity=100)'" style="FILTER: gray alpha( opacity=70); CURSOR: hand" onmouseout="this.style.filter=' gray alpha( opacity=70)'" border=0 title="反选"><img onclick='listen_check()' src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102056qez9k4i9qxnq9xeg.jpg" onmouseover="this.style.filter=' alpha( opacity=100)'" style="FILTER: gray alpha( opacity=70); CURSOR: hand" onmouseout="this.style.filter=' gray alpha( opacity=70)'" border=0 title="播放"></div>
  129. </td></tr>
  130. <TR>
  131. <TD height=1>
  132. </td>
  133. </tr>
  134. <TR>
  135. <TD>
  136. <div id=list_tbl style="margin-top:2;margin-left:20; width:374px; height:201px; overflow:auto"></div>
  137. </td>
  138. </tr>
  139. <TR>
  140. <TD height=10>
  141. </td>
  142. </tr>
  143. <TR>
  144. <TD align="center">
  145. <div style="position:relative;"><DIV id=stat style="position:absolute;left:-135px; top:6px"></div></div>
  146. <OBJECT id=SyesPlayer style="MARGIN-TOP: 6px; FILTER: gray()" height=22 width=341 classid=CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95><PARAM NAME="AutoStart" VALUE="true"><PARAM NAME="volume" VALUE="0"><PARAM NAME="ShowPositionControls" VALUE="0"><PARAM NAME="ShowControls" VALUE="1"><PARAM NAME="ShowStatusBar" VALUE="1"></OBJECT><br><br>
  147. <img src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053j3jnxcxn1z6d3gz9.jpg" border=0 onMouseOut="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053j3jnxcxn1z6d3gz9.jpg'" onMouseOver="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053nivy4hynhyjdwn3z.jpg'" alt="前首" type=button onclick='syes_Previous()' onfocus='this.blur()' style="CURSOR: hand"><img src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102050n4hqf8e4gefl33uu.jpg" border=0 onMouseOut="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102050n4hqf8e4gefl33uu.jpg'" onMouseOver="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102050g69egmmegvd6eegu.jpg'" alt="停止" type=button onfocus='this.blur()' onclick='document.SyesPlayer.stop()' style="CURSOR: hand"><img src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053mphss85rhschssys.jpg" border=0 onMouseOut="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053mphss85rhschssys.jpg'" onMouseOver="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053yrcbt1xz5eq51r1e.jpg'" alt="暂停" type=button onfocus='this.blur()' onclick='document.SyesPlayer.pause()' style="CURSOR: hand"><img src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102049rwjj9ab3l2a4uya3.jpg" border=0 onMouseOut="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102049rwjj9ab3l2a4uya3.jpg'" onMouseOver="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102050yymg1qy3q55kpz3g.jpg'" alt="播放" type=button onfocus='this.blur()' onclick='document.SyesPlayer.play()' style="CURSOR: hand"><img src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053b5xnzhv29v999xux.jpg" border=0 onMouseOut="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102053b5xnzhv29v999xux.jpg'" onMouseOver="this.src='http://bbs.danyangnet.com/data/attachment/forum/201111/27/102056hrhhv4x08hrvazc8.jpg'" alt="后首" type=button onclick='syes_next()' onfocus='this.blur()' style="CURSOR: hand"></TABLE>
  148. <TABLE height=170 width="87%" border=0>
  149. <TBODY>
  150. <TR>
  151. <TD style="PADDING-RIGHT: 5px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; PADDING-TOP: 5px" align=left width=5 height=180>
  152. </TD>
  153. <TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 0px; PADDING-BOTTOM: 10px; PADDING-TOP: 0px" width=368 height=170><FIELDSET style="border:1px none; OVERFLOW: auto; WIDTH: 368px; HEIGHT: 100px"><FONT color=#ffffff><FONT color=#000000>
  154. <div align="center">
  155. <PRE style="FONT-SIZE: 9pt;font-family:verdana;margin-left:20;line-height=18px;">
  156. 专辑中文名: 色
  157. 专辑英文名: Substance Desire & Spirit
  158. 艺术家: 邓伟标
  159. 资源格式: APE
  160. 发行时间: 2006年

  161. 唱片介绍:
  162. 有人说这是个毫不诗意的物质时代,
  163. 但邓伟标的音乐,
  164. 却总是淋漓尽致地流露出一种诗歌般抒情
  165. 又深刻的音乐意蕴--无论是他前期创作的
  166. 《空》《千江汇流》或《古城今昔》
  167. 专辑还是现在的这张《色》。
  168. 与大多数音乐家不同,
  169. 邓伟标似乎不愿满足于严格遵循任何音乐
  170. 流派既定的规则。
  171. 虽然他那悦耳的音乐韵味仍然穿透心灵,
  172. 而他对动摇和颠覆传统审美观所作的许多
  173. 尝试却源自他独具诗人气质的音乐灵感
  174. 和自觉的人文关怀。
  175. 在这张融合了传统与现代多种音乐风格的
  176. 温暖的音乐专辑背后,
  177. 是邓伟标打破流派界限的一种文化创造,
  178. 是一颗不被物质与传统驯服之心的优雅追求。
  179. 但愿由他心灵深处流畅出的蜿蜒情绪,
  180. 不会被大量音响创造的宽广音场所淹没,
  181. 从而让人在音乐的感染下能重获生命最初的感动。

  182. 编辑:韭菜的博客/20111127

  183. </div>
  184. </PRE></FONT><BR>
  185. <IMG src="http://bbs.danyangnet.com/data/attachment/forum/201111/27/103825puiay5t959oo9cdf.gif" width="328" height="53">
  186. <span title="****" id="position" style="position:absolute;cursor:hand; left:205px; top:-31px; z-index:2;color:white" onmousedown="TrackPosition()"; onfucus=this.blur()></span>
  187. <script>set_list();all_check();listen_check();</script> <script event=EndOfStream for=SyesPlayer language=javascript>syes_next();</script> <script language=javascript for=SyesPlayer Event=Error> var subject=subject_arr[inx];SyesPlayer.stop(); if(max_count==1) {err_stat=true;}else {syes_next()} </script>

  188. </body>
  189. </html>
复制代码

 楼主| 发表于 2011-12-3 08:14:17 | 显示全部楼层 来自 中国江苏镇江
本帖最后由 耘 于 2011-12-3 08:14 编辑

请各位先保存下来,并做好作业,详细的调用稍后慢慢分享。
发表于 2011-12-7 16:49:39 | 显示全部楼层 来自 中国广东惠州
来抄写作业
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|手机版|Archiver|丹阳新闻网(https://www.dy001.cn) ( 苏ICP备05003163号 )

GMT+8, 2024-11-22 10:36 , Processed in 0.196381 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表