Alvinmedia.js
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:4k
源码类别:

外挂编程

开发平台:

ASP/ASPX

  1. function AlvinInit()
  2. {
  3. AlvinPlayer = document.getElementById("AlvinWmaPlayer");
  4. AlvinControls = AlvinPlayer.Controls;
  5. AlvinCurrentMedia = AlvinPlayer.currentMedia;
  6. AlvinNetwork = AlvinPlayer.Network;
  7. AlvinSettings = AlvinPlayer.Settings;
  8. AlvinGetBackInfo();
  9. AlvinSettings.autoStart = true;
  10. }
  11. function AlvinNewPlay(AlvinSongPath)
  12. {
  13. AlvinPlayer.url = AlvinSongPath;
  14. AlvinPlay();
  15. }
  16. function AlvinPlay()
  17. {
  18. AlvinControls.play();
  19. }
  20. function AlvinPause()
  21. {
  22. AlvinControls.pause();
  23. }
  24. function AlvinStop()
  25. {
  26. AlvinControls.stop();
  27. }
  28. function AlvinGoPosition(args)
  29. {
  30. AlvinControls.currentPosition = args;
  31. AlvinMediaNow();
  32. }
  33. function AlvinVolume(tempAlvinVolume)
  34. {
  35. AlvinSettings.volume = tempAlvinVolume;
  36. }
  37. function AlvinClear()
  38. {
  39. id3 = "";
  40. AlvinDuration = 0;
  41. AlvinDurationString = "00:00";
  42. AlvinPosition = 0;
  43. AlvinPositionString = "00:00";
  44. AlvinDownload = 0;
  45. };
  46. function AlivnWMARL(args)
  47. {
  48. AlvinPlayer.Settings.balance  =  args;
  49. }
  50. function AlvinMediaNow()
  51. {
  52. AlvinPosition = AlvinControls.currentPosition;
  53. if(AlvinDuration > 0)
  54. {
  55. AlvinPositionPer = Math.floor((AlvinPosition * 100) / AlvinDuration);
  56. }
  57. else
  58. {
  59. AlvinPositionPer = 0;
  60. }
  61. AlvinPositionString = AlvinControls.currentPositionString;
  62. if(AlvinPositionString.length < 1)
  63. {
  64. AlvinPositionString = "00:00";
  65. }
  66. AlvinDownload = AlvinNetwork.downloadProgress;
  67. AlvinGetBackInfo();
  68. }
  69. function AlvinTime()
  70. {
  71. AlvinPosition = AlvinControls.currentPosition;
  72. if(AlvinDuration > 0)
  73. {
  74. AlvinPositionPer = Math.floor((AlvinPosition * 100) / AlvinDuration);
  75. }
  76. else
  77. {
  78. AlvinPositionPer = 0;
  79. }
  80. AlvinPositionString = AlvinControls.currentPositionString;
  81. if(AlvinPositionString.length < 1)
  82. {
  83. AlvinPositionString = "00:00";
  84. }
  85. AlvinDownload = AlvinNetwork.downloadProgress;
  86. AlvinGetBackInfo();
  87. }
  88. function AlvinGetBackInfo()
  89. { var str = AlvinPositionString + "  " + AlvinDurationString;
  90. var AlvinFlash = document.getElementById("AlvinFlash");
  91. AlvinFlash.SetVariable("wbP",AlvinPosition);
  92. AlvinFlash.SetVariable("wbD",AlvinDuration);
  93. AlvinFlash.SetVariable("wbPS",str);
  94. AlvinFlash.SetVariable("wbPP",AlvinPositionPer); 
  95. AlvinFlash.SetVariable("wbDL",AlvinDownload);
  96. AlvinFlash.SetVariable("wbPST",AlvinPlayState);
  97. }
  98. function AlivnSendID3()
  99. {
  100. id3 = "";
  101. var al = AlvinPlayer.currentMedia.getItemInfo("Album");
  102.       var ti = AlvinPlayer.currentMedia.getItemInfo("title");
  103.       var ft = AlvinPlayer.currentMedia.getItemInfo("FileType");
  104.       var cp = AlvinPlayer.currentMedia.getItemInfo("Copyright");
  105.       var au = AlvinPlayer.currentMedia.getItemInfo("Author");
  106. var de = AlvinPlayer.currentMedia.getItemInfo("Description");
  107. var sz = AlvinPlayer.currentMedia.getItemInfo("FileSize")/1024/10.24;
  108. //var id3timet = AlvinDuration - AlvinDuration%1;
  109. var id3timet = Math.round(AlvinDuration);
  110. var id3timem = id3timet%60;
  111. var id3timef = (id3timet - id3timem)/60;
  112. var id3time = id3timef + "分" + id3timem + "秒";
  113. sz = Math.round(sz)/100;
  114. sz += " MB"
  115. //alert(AlvinCurrentMedia.getItemInfo("sourceURL");
  116. if (ti != "") id3 += "<p align='right'>歌名: "+ti+"</p>";
  117. if (au != "") id3 += "<p align='right'>歌手: "+au+"</p>";
  118. if (al != "") id3 += "<p align='right'>专辑: "+al+"</p>";
  119. if (cp != "") id3 += "<p align='right'>版权: "+cp+"</p>";
  120. if (de != "") id3 += "<p align='right'>注释: "+de+"</p>";
  121. if (ft != "") id3 += "<p align='right'>类型: "+ft+" 格式文件</p>";
  122.       if (sz != "") id3 += "<p align='right'>大小: "+sz+"</p>";
  123. id3 += "<p align='right'>持续时间: "+id3time+"</p>";
  124. AlvinFlash.SetVariable("ID3str",id3);
  125. }
  126. function AlvinSendPlayNext()
  127. {
  128. AlvinClear();
  129. AlvinStopInterval();
  130. var AlvinFlash = document.getElementById("AlvinFlash");
  131. AlvinFlash.SetVariable("wbIPN","1");
  132. }
  133. function AlvinStartOvertime()
  134. {
  135. AlvinOvertimeInterval = window.setTimeout("AlvinSendPlayNext()",60000); //设置缓冲超过 60 秒,便跳过下一首
  136. }
  137. function AlvinStopOvertime()
  138. {
  139. window.clearTimeout(AlvinOvertimeInterval);
  140. }
  141. function AlvinStartInterval()
  142. {
  143. AlvinInterval = window.setInterval("AlvinMediaNow()", 100);
  144. }
  145. function AlvinStopInterval()
  146. {
  147. window.clearInterval(AlvinInterval);
  148. }