U.MPlayer.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  1. Namespace.register("U.MPlayer"); //音乐播放器区域
  2. //#region 音乐播放器
  3. U.Ut.AddObj(U.MPlayer, { "IsUpPos": true, "IsP": true, "Time": null, "UMPL": null, "UMPP": null, "UMMP": null, "TF": "J", "UTF": ["MPlayer"] });
  4. //统一回调
  5. U.MPlayer.UHD = function (UTF) {
  6. var i, _UCB = U, _UTE = U.MPlayer.UTF, _UAE = Array.apply(this, arguments); _UAE.shift();
  7. for (i = 0; i < _UTE.length; i++) { _UCB = _UCB[_UTE[i]]; }; _UCB[UTF].apply(this, _UAE); //函数执行
  8. }
  9. //#region 初始化音乐播放器
  10. //#region 窗体播放器
  11. //加载音乐播放器
  12. U.MPlayer.InitMusicPlayer = function () {
  13. var _UDOD = $("#UD_SYMM")[0];
  14. (_UDOD && !U.D.SY.ET["FL"]["MO"]) && (_UDOD.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="display:block" width="1" height="1" id="UD_SYMMF" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0"><param name="movie" value="/img/mp3player.swf" /><param name="menu" value="false" /><param name="wmode" value="transparent" /> <param name="quality" value="high" /><param name="bgcolor" value="ffffff" /><param name="allowScriptAccess" value="always" /><embed src="/img/mp3player.swf" quality="high" bgcolor="ffffff" width="1" height="1" name="UD_SYMMF" align="middle" play="true" wmode="transparent" loop="false" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"> </embed></object>'); //<audio id="UD_SYMMF"></audio>
  15. U.D.SY.ET["FL"]["MO"] = $("*UD_SYMMF")[0]; U.MPlayer.UTF = ["MPlayer"]; //音乐播放
  16. }
  17. //点击直接打开音乐播放器
  18. U.MPlayer.DKCSHYY = function () {
  19. if (U.D.SY.ET["FL"]["userid"]) { var _UDOD = $("#UD_SYMMO").addAttrArray({ "style": { "display": "block"} }).Parent(); U.D.PopupWindow(_UDOD); U.MPlayer.DXBFYY(); }
  20. else { U.Dk.CSHYY(US.userInfo); }
  21. }
  22. //初始化音乐播放器
  23. //参数一:文件信息
  24. //参数二:用户信息。
  25. //参数四:userid为用户id。
  26. U.MPlayer.YYLoad = function (UDID, UIF, UDE) {
  27. var _UGE = U.D.SY.ET["FL"], _UDOD = $("#UD_SYMMO"), _UDAD = $("div", $("#UD_SYMRTLT")[0]), _UDCD = _UDAD[0], _UIMG = $("img", _UDCD)[0] || $$("img", {}, _UDCD); UDID = UDID || US.MG; _UGE.er = 0;
  28. _UGE["MO"].Playing = true; setTimeout(U.M.apply(this, [[U.MPlayer.AsynYYLoad, [UDE, UIF, UDID]]]), 0); U.MPlayer.YFOP(U.D.SY.ET["UL"]["WS"][4], $("#UD_SYMRC")[0]); _UGE["LOD"] = $("#UD_SYMRTLC").find("div"); //初始化资料
  29. $(_UIMG).addAttrArray({ "onerror": U.M.ImgError, "title": (_UDAD[4].innerText = UIF.UserNickName || UIF.UserName || "游客"), "src": U.M.GetImgU(UIF.UserThumbnailImageHead), "onclick": [[U.M.StopBubble], [U.U.I.ViewOtherUserInfo, [UIF.UserId]]] }); //用户信息提示
  30. _UDOD[0].style.display = "block"; U.Ut.AddObj(_UGE, { "DID": UDID, "userid": UIF.UserId || UIF.UserID }); //当前使用用户的变量
  31. U.UI.Form({ draw: false, max: false, close: { onclick: U.MPlayer.SYYJY }, id: "UD_SYM", style: { width: "953px", height: "553px" }, content: _UDOD, title: "音乐播放器", hst: { style: { "padding": "0 0 0 10px"} }, bst: { "style": { overflow: "hidden"}} }); //创建窗体
  32. }
  33. //初始化音乐播放界面
  34. U.MPlayer.AsynYYLoad = function (UDE, UIF, UDID) {
  35. if (UDE) { //打印音乐
  36. var _UIF, _UAE = UDE, _UDOD = $("#UD_SYMMLC")[0];
  37. _UDOD.innerText = ""; _UIF = U.MPlayer.YYOP(_UAE, _UDOD);
  38. $("#UD_SYMMLXO")[0].innerHTML = "共有" + _UIF + "首音乐";
  39. }
  40. else { U.Dk.CSHYY(UIF) } //获取音乐
  41. }
  42. //打印文件和文件夹
  43. U.MPlayer.YYOP = function (UDE, UDOD) {
  44. var i, j, _UDTD, _UDSD, _UDMD, UCE, _UDJD, _UIF = 0, _UDFD = $$("frag");
  45. if (UDE.length) {
  46. for (i = 0; i < UDE.length; i++) {
  47. _UDTD = $$("div", { "className": "UD_SYMMLCA" }, (UDOD || _UDFD));
  48. _UDSD = $$("div", { "className": "UD_SYMMLCT", "onclick": [[U.MPlayer.SYYOP, [_UDTD]]] }, _UDTD);
  49. _UDMD = $$("div", { "className": "UD_SYMMLCTI UD_SYI UD_SYMMLCTIO" }, _UDSD);
  50. $$("div", { "className": "UD_SYMMLCTM UTDF", "innerHTML": UDE[i][0].UserallDirectoryName }, _UDSD);
  51. UCE = U.MPlayer.MYYOP(_UDTD, UDE[i][2]); _UIF += UCE[0]; (UCE[1]) && (_UDJD = UCE[1]);
  52. }
  53. }
  54. else {//空音乐提示
  55. _UDTD = $$("div", { "className": "UD_SYMMLCV" }, _UDFD);
  56. $$("div", { "className": "UD_SYMMLCVL UD_SYI" }, _UDTD);
  57. _UDSD = $$("div", { "className": "UD_SYMMLCVR" }, _UDTD);
  58. $$("div", { "className": "UD_SYMMLCVRS", "innerHTML": "这里当前还没有任何歌曲!!" }, _UDSD);
  59. _UDMD = $$("div", { "className": "UD_SYMMLCVRX", "innerHTML": "你可以:" }, _UDSD);
  60. $$("span", { "innerHTML": "云分享添加", "onclick": [[U.D.DT.YYDK, ["Disk", { userid: US.userInfo.userid, directoryid: US.MG}]]] }, _UDMD);
  61. }
  62. UDOD.appendChild(_UDFD); (_UDJD) && (U.M.SCT(_UDJD)); return _UIF;
  63. }
  64. //打印音乐文件
  65. U.MPlayer.MYYOP = function (UDOD, UDE) {
  66. var i, _UDSD, _UDMD, _UDKD, _UTP = ["UserFilesID", "UserDirectoryID"], _UGE = U.D.SY.ET["FL"], _UCE = _UGE["Entity"], _UTF = _UGE["MO"].getStatus(), _UDTD = $$("div", { "className": "UD_SYMMLCO" }, UDOD);
  67. for (i = 0; i < UDE.length; i++) {
  68. _UDSD = $$("ul", { "className": "UD_SYMMLCOO", "ondblclick": [[U.MPlayer.BFYY, [UDE[i], "this"]]] }, _UDTD);
  69. $$("div", { "className": "UD_SYMMLCOOL", "innerHTML": (i < 9 ? "0" : "") + (i + 1) }, _UDSD);
  70. _UDMD = $$("div", { "className": "UD_SYMMLCOOC UTDF", "innerHTML": UDE[i].UserallDirectoryName || UDE[i].UserFilesName }, _UDSD);
  71. $$("div", { "className": "UD_SYMMLCOOR", "innerHTML": "00:00" }, _UDSD);
  72. if (_UCE && ((_UCE[_UTP[0]] && (_UCE[_UTP[0]] == UDE[i][_UTP[0]] || _UCE[_UTP[0]] == UDE[i][_UTP[1]])) || (_UCE[_UTP[1]] && (_UCE[_UTP[1]] == UDE[i][_UTP[0]] || _UCE[_UTP[1]] == UDE[i][_UTP[1]])))) { (_UDKD = _UDSD).ondblclick(_UTF); }
  73. }
  74. (_UCE && !_UDKD) && (U.MPlayer.BFYY(_UCE)); return [UDE.length, _UDKD];
  75. }
  76. //鼠标移动 文字移动
  77. U.MPlayer.MYYOPWZ = function () {
  78. }
  79. //打印好友区域
  80. U.MPlayer.YFOP = function (UDE, UDOD) {
  81. var i, _UDTD, _UDID, _UDSD, _UDJD, _UDFD = $$("frag");
  82. for (i = 0; i < UDE.length; i++) {
  83. _UDTD = $$("div", { "className": "UD_SYMRCO", "title": "查看" + UDE[i].UserName + "音乐列表", "onclick": [[U.Dk.CSHYY, [UDE[i]]]] }, _UDFD);
  84. _UDID = $$("div", { "className": "UD_SYMRCOL" }, _UDTD);
  85. $$("img", { "onerror": U.M.ImgError, "src": U.M.GetImgU(UDE[i].UserThumbnailImageHead) }, _UDID);
  86. _UDSD = $$("div", { "className": "UD_SYMRCOR UTDF" }, _UDTD);
  87. _UDJD = $$("div", { "className": "UD_SYMRCORS" }, _UDSD);
  88. $$("div", { "className": "UD_SYMRCORSL UTDF", "innerHTML": UDE[i].FriendsDescript || UDE[i].UserName, "onclick": [[U.M.StopBubble], [U.U.I.ViewOtherUserInfo, [UDE[i].UserId || UDE[i].UserID]]] }, _UDJD);
  89. $$("div", { "className": "UD_SYMRCORSR UTDF", "innerHTML": "音乐(" + (UDE[i].UMN == null ? UDE[i].CN : UDE[i].UMN || 0) + ")" }, _UDJD);
  90. $$("div", { "className": "UD_SYMRCORX UTDF", "innerHTML": UDE[i].UserIndividualitysignature || "暂时没有填写个人介绍" }, _UDSD);
  91. }
  92. UDOD.innerText = ""; UDOD.appendChild(_UDFD);
  93. }
  94. //切换好友和热门
  95. U.MPlayer.RMQHYY = function (UDOD, UTF) {
  96. if (!UTF || !U.U.L.isLogin(3)) {
  97. var i, _UDE = [U.D.SY.ET["UL"]["WS"][4], "#F14242", "UD_SYMRQR UD_SYMRQRO", "UD_SYMRQZ"], _UDPD = $(UDOD).Parent(), _UDAD = $("div", _UDPD);
  98. if (UTF) { _UDE[0] = US.Friend[1]; _UDE[1] = "#1796F5"; _UDE[2] = "UD_SYMRQZ"; _UDE[3] = "UD_SYMRQR UD_SYMRQZO"; }
  99. for (i = 0; i < _UDAD.length; i++) { _UDAD[i].className = _UDE[i + 2]; }; _UDPD.style.border = "1px solid " + _UDE[1];
  100. if (_UDE[0]) { U.MPlayer.YFOP(_UDE[0], $("#UD_SYMRC")[0]) } else { U.Alert("请登录查看"); } //打印查看
  101. }
  102. }
  103. //#endregion
  104. //#endregion
  105. //#region 点击播放音乐
  106. //点击播放音乐
  107. U.MPlayer.BFYY = function (UDE, UDOD, UTF) {
  108. U.MPlayer.TBFYY(UDE, UDOD, UTF);
  109. // setTimeout(U.M.apply(this, [[U.MPlayer.TBFYY, [UDE, UDOD, UTF]]]), 0);
  110. }
  111. //点击直接播放
  112. U.MPlayer.TBFYY = function (UDE, UDOD, UTF) {
  113. var _userid = US.userInfo.userid, _UGE = U.D.SY.ET["FL"], _UDAD = $("#UD_SYMRTLC").Child(), _UDCD = $(_UDAD[1]).Child();
  114. //设置样式播放样式
  115. $("#UD_SYMRTLTRX")[0].innerHTML = UDE.UserallDirectoryName || UDE.UserFilesName; $("#UD_SYMRTLTLO")[0].style.display = "block";
  116. _UDAD[0].innerText = _UDAD[2].innerText = "00:00"; _UDCD[1].style.width = _UDCD[2].style.left = "0px"; _UGE["Entity"] = UDE;
  117. U.MPlayer.DXBFYY(); U.MPlayer.ZPYY([$("#UD_SYMMLSK")[0], $("#UD_SYMRTLTLO")[0]], true); U.MPlayer.YSBFYY(UDOD, _UGE["PF"]["OB"]); //播放的位置样式
  118. //修改播放的时间
  119. (_userid == US.userInfo.userid) && (UDE.UserDirectoryModifyTime = U.MT.toTimeStamp(new Date()), U.A.Request(US.Auth, ["SaveFileContent", UDE.UserDirectoryID, ""], U.M.apply, [""]));
  120. (!UTF) && (_UGE["MO"].loadAplay(US.fs + UDE.UserFilesServerName, 0.6)); //播放音乐
  121. }
  122. //获取最近排序的音乐
  123. U.MPlayer.PXYYOP = function (DID, userid) {
  124. var _UDE, _UDOD = $("#UD_SYMMLC")[0], _UDFL = U.D.SY.ET["FL"]; DID = DID || _UDFL["DID"]; userid = userid || _UDFL["userid"]; U.Alert("列表加载中,请稍后...");
  125. _UDE = _$(U.Dk.LE.GM(DID || US.MG)).Like({ "UserDirectoryModifyTime": "Date", "UserDirectoryExtendType": "mp3" }); //获取所有播放过的音乐
  126. _UDE = U.M.Sequence(_UDE, "UserDirectoryModifyTime", U.MT.SizeComparison).reverse(); //排序播放
  127. _UDOD.innerText = ""; U.MPlayer.MYYOP(_UDOD, _UDE);
  128. }
  129. //播放区域大小调整
  130. U.MPlayer.DXBFYY = function () {
  131. var _UDOD = $("#UD_SYMRTLT"), _UDAD = _UDOD.Child();
  132. _UDOD[0].style.width = (_UDAD[0].clientWidth + _UDAD[1].clientWidth + 18) + "px"; //加载音乐
  133. }
  134. //#region 音乐播放器调整
  135. //点击展开和缩小
  136. U.MPlayer.SYYOP = function (UDOD) {
  137. var _UDAD = $(UDOD).Child(), _UDTD = $(_UDAD[0]).Child()[0], _UDE = _UDAD[1].style.display == "none" ? ["block", " UD_SYMMLCTIO"] : ["none", ""];
  138. $(_UDTD).addAttrArray({ "className": "UD_SYI UD_SYMMLCTI" + _UDE[1] }); _UDAD[1].style.display = _UDE[0];
  139. }
  140. //设置播放样式设置
  141. U.MPlayer.YSBFYY = function (UDOD, UDTD) {
  142. var i, _UDSD, _UGE = U.D.SY.ET["FL"], _UDE = [[UDTD, "", _UGE["PF"]["HL"], ""], [UDOD, "UD_SYMMLCOOB", "", " UD_SYI UD_SYMMLCTI"]]; U.Ut.AddObj(_UGE["PF"], { "OB": UDOD, "HL": $("div", UDOD)[0].innerText });
  143. for (i = 0; i < _UDE.length; i++) { (_UDSD = _UDE[i][0]) && (_UDSD.className = "UD_SYMMLCOO " + _UDE[i][1], $("div", _UDSD).addAttrArray({ "innerHTML": _UDE[i][2], "className": "UD_SYMMLCOOL" + _UDE[i][3] }, 0)); }
  144. }
  145. //点击音乐播放暂停
  146. U.MPlayer.SDZT = function (UDOD) {
  147. var _UTF, _UGE = U.D.SY.ET["FL"];
  148. if (_UGE["UBMT"]) { U.MPlayer.AsynSYBFYY(_UGE["Entity"]); _UGE["UBMT"] = false; _UTF = true; } //播放音乐
  149. U.MPlayer.ZPYY(UDOD, _UTF); //播放停止样式
  150. }
  151. //暂停和播放
  152. U.MPlayer.ZPYY = function (UDOD, UTF) {
  153. var i, _UDTD = U.D.SY.ET["FL"]["MO"], _UDE = [{ "className": "UD_MPLZ UD_SYMMLSO UD_SYI UD_SYMMLSK", "title": "暂停" }, { "className": "UD_SYMRTLTLOO UD_SYI", "title": "暂停"}];
  154. if (!UTF && !_UDTD.pauseOstart(false)) { U.Ut.AddObj(_UDE[0], { "className": _UDE[0].className + "O", "title": (_UDE[0].title = _UDE[1].title = "播放") }); _UDE[1].className += " UD_SYMRTLTLOT"; }
  155. UDOD[1] = $(UDOD[1]).Child()[0]; for (i = 0; i < UDOD.length; i++) { $(UDOD[i]).addAttrArray(_UDE[i]); } //设置值
  156. }
  157. //关闭音乐
  158. U.MPlayer.SYYJY = function () {
  159. var _UDOD = U.D.SY.ET["FL"]["MO"];
  160. if (_UDOD.getStatus() == true) { U.MPlayer.ZPYY[$("#UD_SYMMLSK")[0], $("#UD_SYMRTLTLO")[0]]; } //正在播放停止播放
  161. else { _UDOD.pauseOstart(true); }
  162. }
  163. //#endregion
  164. //#endregion
  165. //#region 音乐播放添加
  166. //直接听音乐 直接听了添加到我的音乐列表里
  167. U.MPlayer.TYY = function (UDE) {
  168. if (UDE) {
  169. if (US.userInfo.userid) { U.MPlayer.SCYYJY(UDE, U.M.apply(this, [[U.MPlayer.YYLoad, [US.MG, US.userInfo, null]]])); } //登录用户添加到自己的列表下
  170. else { U.D.SY.ET["FL"]["Entity"] = UDE; U.MPlayer.YYLoad(null, {}, [[{ "UserallDirectoryName": "试听列表" }, [], [UDE]]]); } //游客用户
  171. }
  172. }
  173. //音乐到试听类表
  174. U.MPlayer.SCYYJY = function (UDE, UCB) {
  175. if (!U.U.L.isLogin(3)) {
  176. UDE = UDE || U.D.SY.ET["FL"]["Entity"];
  177. U.A.Request(US.Auth, ["CopyAndPasteFiles", US.userInfo.userid, US.MG, UDE.UserFilesID || UDE.UserDirectoryID, ""]), U.MPlayer.AsynSCYYJY, ["", US.MG, [UDE], 0, UCB, US.userInfo.userid, null, "Copy"]; //添加到用户列表
  178. }
  179. }
  180. //异步
  181. U.MPlayer.AsynSCYYJY = function (r) {
  182. var context = r.context, _UFN = context[4]; context[4] = null;
  183. U.D.SY.ET["FL"]["Entity"] = U.Dk.RE.AsynUFStick(r); //回调函数
  184. (_UFN) && (_UFN()); U.Alert("成功收藏该音乐~"); //收藏成功
  185. }
  186. //添加列表
  187. U.MPlayer.TJYYLB = function () {
  188. U.D.DT.YYDK("Disk", { "userid": US.userInfo.userid, "directoryid": US.MG }); //打开网盘
  189. U.Dk.RE.WPXJWJ("folder", $("#UD_SYW")[0]); //新建文件夹
  190. }
  191. //#endregion
  192. //#region flash交互
  193. //#region 播放数据更新
  194. //更新下载的进度 缓冲
  195. U.MPlayer.ULD = function (UTL, UST, UTF) {
  196. var _UGE = U.D.SY.ET["FL"], _UW = _UGE["LOD"][1].offsetWidth; _UGE["LOD"][2].style.width = _UW * UTL / 100 + "px"; //更新的进度
  197. if (!UTF && _UGE["BM"] && (UTL == 100 || (UST % 60) >= 4)) { U.D.SY.ET["FL"]["MO"].pauseOstart(false); _UGE["BM"] = false; } //进度更新到制定位置播放
  198. }
  199. //播放的更新
  200. U.MPlayer.UPT = function (UPT, UTM, ULD, USL) {
  201. var _UGE = U.D.SY.ET["FL"], _UDOD = _UGE["MO"], _UDAD = _UGE["LOD"], _UTF = _UDOD.getStatus(), _UST = USL - UPT; _UST = _UST / 60 > 0 ? true : (_UST % 60) >= 10; _UGE["TI"] = UTM;
  202. if (ULD == 1 || _UST) {//下载完成
  203. (!_UTF && _UGE["BM"]) && (_UDOD.pauseOstart(false), _UGE["BM"] = false);
  204. _UDAD[0].innerText = parseInt(UPT / 60).prefixInteger() + ":" + parseInt(UPT % 60).prefixInteger(); _UDAD[3].style.width = _UDAD[4].style.left = (_UDAD[1].offsetWidth * (UTM ? (UPT / UTM) : 0)) + "px"; ; //播放时间
  205. }
  206. else { (_UTF && UPT) && (_UDOD.pauseOstart(true), _UGE["BM"] = true); } //暂停播放
  207. }
  208. //加载成功后总时间
  209. U.MPlayer.GD = function (ULD) {
  210. var _UGE = U.D.SY.ET["FL"], _UDTD = _UGE["PF"]["OB"] ? $(_UGE["PF"]["OB"]).Child() : null, _UDAD = _UGE["LOD"]; _UGE["TI"] = ULD;
  211. _UDAD[5].innerText = parseInt(ULD / 60).prefixInteger() + ":" + parseInt(ULD % 60).prefixInteger(); (_UDTD[2]) && (_UDTD[2].innerText = _UDAD[5].innerText);
  212. }
  213. //错误处理
  214. U.MPlayer.Error = function (UE) {
  215. var _UGE = U.D.SY.ET["FL"]; (US.userInfo.userid) && (U.Alert("此音乐暂停服务。"));
  216. if (_UGE.er++ < 10) { U.MPlayer.PNM(); } else { _UGE["MO"].pauseOstart(true); _UGE.er = 0; } //错误音乐太多 停止
  217. }
  218. //#endregion
  219. //#region 上下首
  220. //切换播放模式
  221. U.MPlayer.QHMS = function (UDOD) {
  222. var _UDFL = U.D.SY.ET["FL"], _UTF = _UDFL["TF"], _UDE = ["J", "UD_SYMRTRLO", "随机"];
  223. switch (_UTF) {
  224. case "J": _UDE = ["D", "UD_SYMRTRLT", "单曲"]; break;
  225. case "D": _UDE = ["S", "", "列表"]; break;
  226. }
  227. _UDFL["TF"] = _UDE[0]; $(UDOD).addAttrArray({ "className": "UD_SYMRTRL UD_SYI " + _UDE[1], "title": _UDE[2] }); U.Alert("切换到" + _UDE[2] + "模式");
  228. }
  229. //flash听完一首后直接下一首
  230. U.MPlayer.PNM = function () {
  231. U.MPlayer.LBSXYY(1);
  232. }
  233. //首页音乐上下首
  234. U.MPlayer.TSDSXS = function () {
  235. var _UDE = U.D.SY.ET["FL"]["Entity"];
  236. if (_UDE["bs"]) { _UDE["bs"](); }
  237. else { U.MPlayer.SDSXS(1, true); }
  238. }
  239. //上下首
  240. U.MPlayer.SDSXS = function (UIE, UTF) {
  241. var _UDE, _UIM, _UTF, _UDSD, _UGE = U.D.SY.ET, _UDOD = $("#UD_MP.UD_MPRRR").Child(), _UDTD = _UGE["FL"]["PF"]["OB"], _UTP = _UGE["FL"]["TF"], _UCE = _UGE["FL"]["Entity"], _UIF = US.userInfo; (_UTP == "D" && UTF) && (_UTP = "");
  242. if ((_UTF = (_UIF.UserId && _UDOD[0].className != "UD_MPRRRL UD_MPRRRLO"))) { _UDE = U.Dk.DiskOperatingSwitch(_UIF.UserId)[0]; } else { _UDE = _UGE["UL"]["WS"][0]; } //随机播放模式 //播放音乐
  243. switch (_UGE["FL"]["TF"]) {
  244. case "J": _UIM = U.P.getRandom(_UDE.length);
  245. _UDE = _UDE[_UIM];
  246. _UDOD = $(_UDOD[_UTF ? 2 : 3]).childg()[1];
  247. _UDOD = $(_UDOD).Child()[UIE];
  248. break; //随机
  249. case "D": _UGE["FL"]["Entity"] = null; _UDE = _UCE; _UDOD = _UDTD; break; //单曲循环
  250. default: //列表循环
  251. if (_UDTD) { _UDSD = $(_UDTD)[UIE == 1 ? "next" : "prev"]()[0]; if (!_UDSD) { if (UIE == -1) { _UDSD = _UDTD; break; } } } //获取
  252. if (!_UDSD) {
  253. _UIM = _UDE.indexOf(_UCE); _UIM = _UIM + UIE; if (_UIM < 0) { _UIM = 0 } else if (_UIM == _UDE.length) { if (!_UTF && !(_UDE.length % 100)) { U.MPlayer.GSDSXS(_UDE.length, UIE); return; } else { _UIM = 0; } }
  254. _UDSD = $(_UDOD[_UTF ? 2 : 3]).childg()[1];
  255. _UDSD = $(_UDSD).Child()[_UIM];
  256. _UDE = _UDE[_UIM];
  257. }
  258. _UDOD = _UDSD;
  259. break;
  260. }
  261. if (_UDOD) { _UDOD.ondblclick(); } else { U.MPlayer.SYBFYY(_UDE); } //播放音乐
  262. }
  263. //获取随机音乐
  264. U.MPlayer.GSDSXS = function (US, UIE, UCB) {
  265. //#error
  266. U.A.Request(US.CD, [US.DB, "UseStudio_Disk", "UD_S_GetUserAlbu", US + 1, US + 100]), U.MPlayer.AsynGSDSXS, [null, UIE, UCB]; //等待播放中
  267. // U.A.Request(US.Auth,"UseStudioDisk.GetUserAlbu", [US + 1, US + 100]), U.MPlayer.AsynGSDSXS, [null, UIE, UCB]; //等待播放中
  268. }
  269. //获取随机音乐异步
  270. U.MPlayer.AsynGSDSXS = function (r) {
  271. var _UDE = U.D.SY.ET["UL"]["WS"], context = r.context, _UIE = context[1], _UCB = context[2]; r = r.value;
  272. if (r && r.length) { _UDE[0] = _UDE[0].concat(r); } else { UIE = 0; } _UCB ? _UCB() : U.MPlayer.SDSXS(_UIE); //获取播放音乐
  273. }
  274. //上下首歌曲
  275. U.MPlayer.SXYY = function (TF) {
  276. switch (U.D.SY.ET["FL"]["TF"]) {
  277. case "J": U.MPlayer.SFSXYY(); break;
  278. case "D": U.D.SY.ET["FL"]["PF"]["OB"].ondblclick(); break;
  279. default: U.MPlayer.LBSXYY(TF); break;
  280. }
  281. }
  282. //列表顺序
  283. U.MPlayer.LBSXYY = function (ITF) {
  284. var i, _UDCD, _UTF, _UDFL = U.D.SY.ET["FL"], _UDOD = _UDFL["PF"]["OB"], _UDAD = $("ul", $("#UD_SYMMLC")[0]), _UTL = _UDAD.length;
  285. for (i = 0; i < _UTL; i++) {
  286. if ((_UDCD = _UDAD[i]) == _UDOD) {
  287. if ((_UTF = i + ITF) >= _UTL) { _UDCD = _UDAD[0]; } //最后一首下一首回到第一首
  288. else if (_UTF < 0) { _UDCD = _UDAD[_UTL - 1]; } //第一首回到最后一首
  289. else { (_UDAD[_UTF]) && (_UDCD = _UDAD[_UTF]); } //上下首
  290. _UDCD.ondblclick(); return;
  291. }
  292. }
  293. }
  294. //随机播放
  295. U.MPlayer.SFSXYY = function () {
  296. var _UDAD = $("ul", $("#UD_SYMMLC")[0]), _UTF = U.P.getRandom(_UDAD.length); _UDAD[_UTF - 1].ondblclick();
  297. }
  298. //#endregion
  299. //#region 声音和进度调整调整
  300. //声音调整
  301. U.MPlayer.YYSYTJ = function (UDOD, UL) {
  302. UDOD.title = Math.round(UL) + "%"; U.D.SY.ET["FL"]["MO"].setVol(UL / 100);
  303. }
  304. //静音变化
  305. U.MPlayer.YYJY = function (UDOD, UL) {
  306. var _UDAD = $("div", $(UDOD).Parent());
  307. _UDAD[UL ? "removeClass" : "addClass"]("UD_SYMMLSYOO", 0);
  308. U.MPlayer.YYSYTJ(_UDAD[1], UL);
  309. }
  310. //调节进度
  311. U.MPlayer.YYST = function (UDOD, UL) {
  312. var _UGE = U.D.SY.ET["FL"], _UTF = event.type == "mouseup";
  313. _UGE["MO"].SetTF(_UTF); if (_UTF) { _UGE["MO"].SkipTo(_UGE["TI"] * UL * 10); }
  314. }
  315. //调节声音和进度
  316. U.MPlayer.YDSYTJ = function (UDOD, UCB) {
  317. UCB = [U.MPlayer.OVM, [$(UDOD).Parent(), UCB]];
  318. document.onmousemove = U.M.apply(UDOD, [[UDOD.setCapture], UCB]);
  319. document.onmouseup = U.M.apply(UDOD, [[U.MPlayer.TYDSYTJ, [UDOD]], UCB]);
  320. }
  321. //进度调变化
  322. U.MPlayer.OVM = function (UDOD, UCB) {
  323. var _UDAD = $("div", UDOD), _UCW = UDOD.clientWidth, _UL = ((U.M.GetMousep()["X"] - U.M.pageXY(UDOD)[1]) / _UCW) * 100;
  324. _UL = _UL < 0 ? 0 : (_UL > 100) ? 100 : _UL; _UDAD[_UDAD.length - 2].style.width = _UDAD[_UDAD.length - 1].style.left = _UL + "%";
  325. (UCB) && (UCB(UDOD, _UL));
  326. }
  327. //释放调节
  328. U.MPlayer.TYDSYTJ = function (UDOD) {
  329. UDOD.releaseCapture(); document.onmouseup = document.onmousemove = null;
  330. }
  331. //#endregion
  332. //#endregion
  333. //#endregion