APlayer/dist/APlayer.min.js

2 lines
44 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,n){"use strict";function a(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=/mobile/i.test(window.navigator.userAgent),o={secondToTime:function(e){var t=function(e){return e<10?"0"+e:""+e},n=Math.floor(e/3600),a=Math.floor((e-3600*n)/60),i=Math.floor(e-3600*n-60*a);return(n>0?[n,a,i]:[a,i]).map(t).join(":")},getElementViewLeft:function(e){var t=e.offsetLeft,n=e.offsetParent,a=document.body.scrollLeft+document.documentElement.scrollLeft;if(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement)for(;null!==n&&n!==e;)t+=n.offsetLeft,n=n.offsetParent;else for(;null!==n;)t+=n.offsetLeft,n=n.offsetParent;return t-a},getElementViewTop:function(e){for(var t=e.offsetTop,n=e.offsetParent,a=0;null!==n;)t+=n.offsetTop,n=n.offsetParent;return a=document.body.scrollTop+document.documentElement.scrollTop,t-a},isMobile:i,storage:{set:function(e,t){localStorage.setItem(e,t)},get:function(e){return localStorage.getItem(e)}},nameMap:{dragStart:i?"touchstart":"mousedown",dragMove:i?"touchmove":"mousemove",dragEnd:i?"touchend":"mouseup"},randomOrder:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(void 0).options.audio.length;return function(e){for(var t=e.length-1;t>=0;t--){var n=Math.floor(Math.random()*(t+1)),a=e[n];e[n]=e[t],e[t]=a}return e}([].concat(a(Array(e))).map(function(e,t){return t}))}};t.default=o},function(e,t,n){"use strict";var a,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};a=function(){return this}();try{a=a||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":i(window))&&(a=window)}e.exports=a},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(11),o=a(i),r=n(12),s=a(r),l=n(13),u=a(l),c=n(14),p=a(c),d=n(15),h=a(d),f=n(16),y=a(f),v=n(17),m=a(v),g=n(18),w=a(g),b=n(19),M=a(b),x=n(20),T=a(x),k=n(21),L=a(k),_=n(22),q=a(_),E={play:o.default,pause:s.default,volumeUp:u.default,volumeDown:p.default,volumeOff:h.default,orderRandom:y.default,orderList:m.default,menu:w.default,loopAll:M.default,loopOne:T.default,loopNone:L.default,loading:q.default};t.default=E},function(e,t,n){"use strict";e.exports=n(26)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(5);var a=n(6),i=function(e){return e&&e.__esModule?e:{default:e}}(a);console.log("\n %c APlayer v1.7.0 375c0f7 %c http://aplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;"),t.default=i.default},function(e,t){},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=n(7),s=a(r),l=n(0),u=a(l),c=n(2),p=a(c),d=n(23),h=a(d),f=n(24),y=a(f),v=n(28),m=a(v),g=n(29),w=a(g),b=n(30),M=a(b),x=n(32),T=a(x),k=n(33),L=a(k),_=n(34),q=a(_),E=[],O=function(){function e(t){if(i(this,e),this.options=(0,h.default)(t),this.container=this.options.container,this.playIndex=0,this.paused=!0,this.playedPromise=s.default.resolve(),this.randomOrder=u.default.randomOrder(this.options.audio.length),this.container.classList.add("aplayer"),this.options.lrc&&this.container.classList.add("aplayer-withlrc"),this.options.audio.length>1&&this.container.classList.add("aplayer-withlist"),u.default.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),this.options.mini&&this.container.classList.add("aplayer-narrow"),this.container=this.options.container,2===this.options.lrc||!0===this.options.lrc)for(var n=this.container.getElementsByClassName("aplayer-lrc-content"),a=0;a<n.length;a++)this.options.audio[a]&&(this.options.audio[a].lrc=n[a].innerHTML);this.template=new y.default({container:this.container,options:this.options,randomOrder:this.randomOrder}),this.template.info.offsetWidth<200&&this.template.time.classList.add("aplayer-time-narrow"),this.options.lrc&&(this.lrc=new M.default({container:this.template.lrc,async:3===this.options.lrc,content:this.options.audio.map(function(e){return e.lrc}),player:this})),this.events=new q.default,this.user=new w.default(this),this.bar=new m.default(this.template),this.controller=new T.default(this),this.timer=new L.default(this),this.initAudio(),"random"===this.options.order?this.switchAudio(this.randomOrder[0]):this.switchAudio(0),this.options.autoplay&&this.play(),E.push(this)}return o(e,[{key:"initAudio",value:function(){var e=this;this.audio=document.createElement("audio"),this.audio.preload=this.options.preload;for(var t=0;t<this.events.audioEvents.length;t++)!function(t){e.audio.addEventListener(e.events.audioEvents[t],function(){e.events.trigger(e.events.audioEvents[t])})}(t);this.on("play",function(){e.paused&&e.play()}),this.on("pause",function(){e.paused||e.pause()}),this.on("durationchange",function(){1!==e.audio.duration&&(e.template.dtime.innerHTML=u.default.secondToTime(e.audio.duration))}),this.on("progress",function(){var t=e.audio.buffered.length?e.audio.buffered.end(e.audio.buffered.length-1)/e.audio.duration:0;e.bar.set("loaded",t,"width")}),this.on("error",function(){e.template.author.innerHTML=" - Error happens \u2565\ufe4f\u2565"}),this.on("ended",function(){"none"===e.options.loop?"list"===e.options.order?e.playIndex<e.options.audio.length-1?(e.switchAudio((e.playIndex+1)%e.options.audio.length),e.play()):(e.switchAudio((e.playIndex+1)%e.options.audio.length),e.pause()):"random"===e.options.order&&(e.randomOrder.indexOf(e.playIndex)<e.randomOrder.length-1?(e.switchAudio(e.nextRandomNum()),e.play()):(e.switchAudio(e.nextRandomNum()),e.pause())):"one"===e.options.loop?(e.switchAudio(e.playIndex),e.play()):"all"===e.options.loop&&("list"===e.options.order?e.switchAudio((e.playIndex+1)%e.options.audio.length):"random"===e.options.order&&e.switchAudio(e.nextRandomNum()),e.play())}),this.volume(this.user.get("volume"),!0)}},{key:"switchAudio",value:function(e){var t=this;this.handlePlayPromise(function(){t.events.trigger("switchaudio",e),void 0!==e&&(t.playIndex=e),t.options.audio[t.playIndex].cover?t.template.pic.style.backgroundImage="url('"+t.options.audio[t.playIndex].cover+"')":t.template.pic.style.backgroundImage="",t.template.title.innerHTML=t.options.audio[t.playIndex].name,t.template.author.innerHTML=t.options.audio[t.playIndex].artist?" - "+t.options.audio[t.playIndex].artist:"";var n=t.container.getElementsByClassName("aplayer-list-light")[0];n&&n.classList.remove("aplayer-list-light"),t.container.querySelectorAll(".aplayer-list li")[t.playIndex].classList.add("aplayer-list-light"),t.template.list.scrollTop=33*t.playIndex,t.audio.src=t.options.audio[t.playIndex].url,t.seek(0);var a=void 0;return t.paused||(a=s.default.resolve(t.audio.play()).catch(function(e){console.error(e),t.pause()})),t.lrc&&t.lrc.switch(t.playIndex),1!==t.audio.duration&&(t.template.dtime.innerHTML=t.audio.duration?u.default.secondToTime(t.audio.duration):"00:00"),a})}},{key:"seek",value:function(e){e=Math.max(e,0),this.audio.duration&&(e=Math.min(e,this.audio.duration)),this.audio.currentTime=e,isNaN(this.audio.duration)?this.bar.set("played",0,"width"):this.bar.set("played",e/this.audio.duration,"width"),this.template.ptime.innerHTML=u.default.secondToTime(e)}},{key:"play",value:function(){var e=this;this.handlePlayPromise(function(){e.paused&&(e.paused=!1,e.template.button.classList.remove("aplayer-play"),e.template.button.classList.add("aplayer-pause"),e.template.button.innerHTML="",setTimeout(function(){e.template.button.innerHTML=p.default.pause},100));var t=s.default.resolve(e.audio.play()).catch(function(t){console.error(t),e.pause()});if(e.timer.enable("loading"),e.timer.enable("progress"),e.options.mutex)for(var n=0;n<E.length;n++)e!==E[n]&&E[n].pause();return t})}},{key:"pause",value:function(){var e=this;this.handlePlayPromise(function(){e.paused||(e.paused=!0,e.template.button.classList.remove("aplayer-pause"),e.template.button.classList.add("aplayer-play"),e.template.button.innerHTML="",setTimeout(function(){e.template.button.innerHTML=p.default.play},100)),e.audio.pause(),e.timer.disable("loading"),e.timer.disable("progress")})}},{key:"switchVolumeIcon",value:function(){this.volume()>=.95?this.template.volumeButton.innerHTML=p.default.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=p.default.volumeDown:this.template.volumeButton.innerHTML=p.default.volumeOff}},{key:"volume",value:function(e,t){return e=parseFloat(e),isNaN(e)||(e=Math.max(e,0),e=Math.min(e,1),this.bar.set("volume",e,"height"),t||this.user.set("volume",e),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}},{key:"on",value:function(e,t){this.events.on(e,t)}},{key:"toggle",value:function(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"isMultiple",value:function(){return this.options.audio.length>1}},{key:"nextRandomNum",value:function(){if(this.isMultiple()){var e=this.randomOrder.indexOf(this.playIndex);return e===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[e+1]}return 0}},{key:"addAudio",value:function(e){this.events.trigger("addaudio",e);var t=!this.isMultiple();this.options.audio=this.options.audio.concat(e);for(var n="",a=0;a<e.length;a++)n+='<li><span class="aplayer-list-cur" style="background: '+this.options.theme+';"></span><span class="aplayer-list-index">'+(this.options.audio.length-e.length+a+1)+'</span><span class="aplayer-list-title">'+e[a].name+'</span><span class="aplayer-list-author">'+e[a].artist+"</span></li>";this.template.listOl.innerHTML+=n,t&&this.isMultiple()&&(this.container.classList.add("aplayer-withlist"),this.audio.loop=!1);var i=this.container.querySelectorAll(".aplayer-list li").length;this.template.list.style.height=33*i-1+"px",this.randomOrder=u.default.randomOrder(this.options.audio.length)}},{key:"removeAudio",value:function(e){if(this.events.trigger("removeaudio",e),this.options.audio[e]&&this.options.audio.length>1){var t=this.container.querySelectorAll(".aplayer-list li");this.options.audio.splice(e,1),e===this.playIndex&&(this.options.audio[e+1]?this.switchAudio(e):this.switchAudio(e-1)),this.playIndex>e&&this.playIndex--,t[e].remove();for(var n=e;n<t.length;n++)t[n].getElementsByClassName("aplayer-list-index")[0].textContent=n;1===this.options.audio.length&&this.container.classList.remove("aplayer-withlist"),this.template.list.style.height=parseInt(this.template.list.style.height,10)-33+"px"}}},{key:"destroy",value:function(){E.splice(E.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}},{key:"handlePlayPromise",value:function(e){this.playedPromise=this.playedPromise.then(e).catch(function(e){console.error(e)})}}]),e}();t.default=O},function(e,t,n){"use strict";(function(t){function n(){}function a(e,t){return function(){e.apply(t,arguments)}}function i(e){if(!(this instanceof i))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;if(0===e._state)return void e._deferreds.push(t);e._handled=!0,i._immediateFn(function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._state?r:s)(t.promise,e._value);var a;try{a=n(e._value)}catch(e){return void s(t.promise,e)}r(t.promise,a)})}function r(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===(void 0===t?"undefined":p(t))||"function"==typeof t)){var n=t.then;if(t instanceof i)return e._state=3,e._value=t,void l(e);if("function"==typeof n)return void c(a(n,t),e)}e._state=1,e._value=t,l(e)}catch(t){s(e,t)}}function s(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)o(e,e._deferreds[t]);e._deferreds=null}function u(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function c(e,t){var n=!1;try{e(function(e){n||(n=!0,r(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}var p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d=setTimeout;i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var a=new this.constructor(n);return o(this,new u(e,t,a)),a},i.prototype.finally=function(e){var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){return t.reject(n)})})},i.all=function(e){return new i(function(t,n){function a(e,r){try{if(r&&("object"===(void 0===r?"undefined":p(r))||"function"==typeof r)){var s=r.then;if("function"==typeof s)return void s.call(r,function(t){a(e,t)},n)}i[e]=r,0==--o&&t(i)}catch(e){n(e)}}if(!e||void 0===e.length)throw new TypeError("Promise.all accepts an array");var i=Array.prototype.slice.call(e);if(0===i.length)return t([]);for(var o=i.length,r=0;r<i.length;r++)a(r,i[r])})},i.resolve=function(e){return e&&"object"===(void 0===e?"undefined":p(e))&&e.constructor===i?e:new i(function(t){t(e)})},i.reject=function(e){return new i(function(t,n){n(e)})},i.race=function(e){return new i(function(t,n){for(var a=0,i=e.length;a<i;a++)e[a].then(t,n)})},i._immediateFn="function"==typeof t&&function(e){t(e)}||function(e){d(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},e.exports=i}).call(t,n(8).setImmediate)},function(e,t,n){"use strict";function a(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new a(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(9),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){"use strict";(function(e,t){!function(e,n){function a(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var a={callback:e,args:t};return u[l]=a,s(l),l++}function i(e){delete u[e]}function o(e){var t=e.callback,a=e.args;switch(a.length){case 0:t();break;case 1:t(a[0]);break;case 2:t(a[0],a[1]);break;case 3:t(a[0],a[1],a[2]);break;default:t.apply(n,a)}}function r(e){if(c)setTimeout(r,0,e);else{var t=u[e];if(t){c=!0;try{o(t)}finally{i(e),c=!1}}}}if(!e.setImmediate){var s,l=1,u={},c=!1,p=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){r(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&r(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){r(e.data)},s=function(t){e.port2.postMessage(t)}}():p&&"onreadystatechange"in p.createElement("script")?function(){var e=p.documentElement;s=function(t){var n=p.createElement("script");n.onreadystatechange=function(){r(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(r,0,e)}}(),d.setImmediate=a,d.clearImmediate=i}}("undefined"==typeof self?void 0===e?void 0:e:self)}).call(t,n(1),n(10))},function(e,t,n){"use strict";function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(p===setTimeout)return setTimeout(e,0);if((p===a||!p)&&setTimeout)return p=setTimeout,setTimeout(e,0);try{return p(e,0)}catch(t){try{return p.call(null,e,0)}catch(t){return p.call(this,e,0)}}}function r(e){if(d===clearTimeout)return clearTimeout(e);if((d===i||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function s(){v&&f&&(v=!1,f.length?y=f.concat(y):m=-1,y.length&&l())}function l(){if(!v){var e=o(s);v=!0;for(var t=y.length;t;){for(f=y,y=[];++m<t;)f&&f[m].run();m=-1,t=y.length}f=null,v=!1,r(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var p,d,h=e.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:a}catch(e){p=a}try{d="function"==typeof clearTimeout?clearTimeout:i}catch(e){d=i}}();var f,y=[],v=!1,m=-1;h.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];y.push(new u(e,t)),1!==y.length||v||o(l)},u.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=c,h.addListener=c,h.once=c,h.off=c,h.removeListener=c,h.removeAllListeners=c,h.emit=c,h.prependListener=c,h.prependOnceListener=c,h.listeners=function(e){return[]},h.binding=function(e){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(e){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 16 31"><path d="M15.552 15.168q0.448 0.32 0.448 0.832 0 0.448-0.448 0.768l-13.696 8.512q-0.768 0.512-1.312 0.192t-0.544-1.28v-16.448q0-0.96 0.544-1.28t1.312 0.192z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 17 32"><path d="M14.080 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048zM2.88 4.8q2.88 0 2.88 2.048v18.24q0 2.112-2.88 2.112t-2.88-2.112v-18.24q0-2.048 2.88-2.048z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528zM25.152 16q0 2.72-1.536 5.056t-4 3.36q-0.256 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.704 0.672-1.056 1.024-0.512 1.376-0.8 1.312-0.96 2.048-2.4t0.736-3.104-0.736-3.104-2.048-2.4q-0.352-0.288-1.376-0.8-0.672-0.352-0.672-1.056 0-0.448 0.32-0.8t0.8-0.352q0.224 0 0.48 0.096 2.496 1.056 4 3.36t1.536 5.056zM29.728 16q0 4.096-2.272 7.552t-6.048 5.056q-0.224 0.096-0.448 0.096-0.48 0-0.832-0.352t-0.32-0.8q0-0.64 0.704-1.056 0.128-0.064 0.384-0.192t0.416-0.192q0.8-0.448 1.44-0.896 2.208-1.632 3.456-4.064t1.216-5.152-1.216-5.152-3.456-4.064q-0.64-0.448-1.44-0.896-0.128-0.096-0.416-0.192t-0.384-0.192q-0.704-0.416-0.704-1.056 0-0.448 0.32-0.8t0.832-0.352q0.224 0 0.448 0.096 3.776 1.632 6.048 5.056t2.272 7.552z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8zM20.576 16q0 1.344-0.768 2.528t-2.016 1.664q-0.16 0.096-0.448 0.096-0.448 0-0.8-0.32t-0.32-0.832q0-0.384 0.192-0.64t0.544-0.448 0.608-0.384 0.512-0.64 0.192-1.024-0.192-1.024-0.512-0.64-0.608-0.384-0.544-0.448-0.192-0.64q0-0.48 0.32-0.832t0.8-0.32q0.288 0 0.448 0.096 1.248 0.48 2.016 1.664t0.768 2.528z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 28 32"><path d="M13.728 6.272v19.456q0 0.448-0.352 0.8t-0.8 0.32-0.8-0.32l-5.952-5.952h-4.672q-0.48 0-0.8-0.352t-0.352-0.8v-6.848q0-0.48 0.352-0.8t0.8-0.352h4.672l5.952-5.952q0.32-0.32 0.8-0.32t0.8 0.32 0.352 0.8z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M22.667 4l7 6-7 6 7 6-7 6v-4h-3.653l-3.76-3.76 2.827-2.827 2.587 2.587h2v-8h-2l-12 12h-6v-4h4.347l12-12h3.653v-4zM2.667 8h6l3.76 3.76-2.827 2.827-2.587-2.587h-4.347v-4z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M0.622 18.334h19.54v7.55l11.052-9.412-11.052-9.413v7.549h-19.54v3.725z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 22 32"><path d="M20.8 14.4q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2zM1.6 11.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2zM20.8 20.8q0.704 0 1.152 0.48t0.448 1.12-0.48 1.12-1.12 0.48h-19.2q-0.64 0-1.12-0.48t-0.48-1.12 0.448-1.12 1.152-0.48h19.2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 33 32"><path d="M9.333 9.333h13.333v4l5.333-5.333-5.333-5.333v4h-16v8h2.667v-5.333zM22.667 22.667h-13.333v-4l-5.333 5.333 5.333 5.333v-4h16v-8h-2.667v5.333zM17.333 20v-8h-1.333l-2.667 1.333v1.333h2v5.333h2z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 29 32"><path d="M2.667 7.027l1.707-1.693 22.293 22.293-1.693 1.707-4-4h-11.64v4l-5.333-5.333 5.333-5.333v4h8.973l-8.973-8.973v0.973h-2.667v-3.64l-4-4zM22.667 17.333h2.667v5.573l-2.667-2.667v-2.907zM22.667 6.667v-4l5.333 5.333-5.333 5.333v-4h-10.907l-2.667-2.667h13.573z"></path></svg>'},function(e,t){e.exports='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 32 32"><path d="M4 16c0-6.6 5.4-12 12-12s12 5.4 12 12c0 1.2-0.8 2-2 2s-2-0.8-2-2c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8c1.2 0 2 0.8 2 2s-0.8 2-2 2c-6.6 0-12-5.4-12-12z"></path></svg>'},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t={container:e.element||document.getElementsByClassName("aplayer")[0],mini:e.narrow||!1,autoplay:!1,mutex:!0,lrc:e.showlrc||0,preload:"auto",theme:"#b7daff",loop:"all",order:"list",volume:.7,listFolded:!1,listMaxHeight:e.listmaxheight,audio:e.music};for(var n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);return"[object Array]"!==Object.prototype.toString.call(e.audio)&&(e.audio=[e.audio]),e.audio.map(function(e){return e.name=e.name||e.title,e.artist=e.artist||e.author,e.cover=e.cover||e.pic,e}),e.audio.length<=1&&"one"===e.loop&&(e.loop="all"),e}},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=n(2),s=a(r),l=n(25),u=a(l),c=function(){function e(t){i(this,e),this.container=t.container,this.options=t.options,this.randomOrder=t.randomOrder,this.init()}return o(e,[{key:"init",value:function(){var e=void 0;e="random"===this.options.order?this.options.audio[this.randomOrder[0]].cover:this.options.audio[0].cover,this.container.innerHTML=(0,u.default)({options:this.options,icons:s.default,cover:e}),this.lrc=this.container.querySelector(".aplayer-lrc-contents"),this.ptime=this.container.querySelector(".aplayer-ptime"),this.info=this.container.querySelector(".aplayer-info"),this.time=this.container.querySelector(".aplayer-time"),this.barWrap=this.container.querySelector(".aplayer-bar-wrap"),this.button=this.container.querySelector(".aplayer-button"),this.list=this.container.querySelector(".aplayer-list"),this.listOl=this.container.querySelector(".aplayer-list ol"),this.played=this.container.querySelector(".aplayer-played"),this.loaded=this.container.querySelector(".aplayer-loaded"),this.thumb=this.container.querySelector(".aplayer-thumb"),this.volume=this.container.querySelector(".aplayer-volume"),this.volumeBar=this.container.querySelector(".aplayer-volume-bar"),this.volumeButton=this.container.querySelector(".aplayer-time button"),this.volumeBarWrap=this.container.querySelector(".aplayer-volume-bar-wrap"),this.loop=this.container.querySelector(".aplayer-icon-loop"),this.order=this.container.querySelector(".aplayer-icon-order"),this.menu=this.container.querySelector(".aplayer-icon-menu"),this.pic=this.container.querySelector(".aplayer-pic"),this.title=this.container.querySelector(".aplayer-title"),this.author=this.container.querySelector(".aplayer-author"),this.dtime=this.container.querySelector(".aplayer-dtime")}}]),e}();t.default=c},function(e,t,n){var a=n(3);e.exports=function(e){"use strict";e=e||{};var t="",n=e.cover,i=a.$escape,o=e.icons,r=e.options,s=a.$each;e.$value,e.$index;return t+='<div class="aplayer-pic"',n&&(t+=' style="background-image: url("',t+=i(n),t+='");"'),t+='>\n <div class="aplayer-button aplayer-play">',t+=o.play,t+='</div>\n</div>\n<div class="aplayer-info">\n <div class="aplayer-music">\n <span class="aplayer-title"></span>\n <span class="aplayer-author"></span>\n </div>\n <div class="aplayer-lrc">\n <div class="aplayer-lrc-contents" style="transform: translateY(0); -webkit-transform: translateY(0);"></div>\n </div>\n <div class="aplayer-controller">\n <div class="aplayer-bar-wrap">\n <div class="aplayer-bar">\n <div class="aplayer-loaded" style="width: 0"></div>\n <div class="aplayer-played" style="width: 0; background: ',t+=i(r.theme),t+=';">\n <span class="aplayer-thumb" style="background: ',t+=i(r.theme),t+=';">\n <span class="aplayer-loading-icon">',t+=o.loading,t+='</span>\n </span>\n </div>\n </div>\n </div>\n <div class="aplayer-time">\n <span class="aplayer-time-inner">\n - <span class="aplayer-ptime">00:00</span> / <span class="aplayer-dtime">00:00</span>\n </span>\n <div class="aplayer-volume-wrap">\n <button type="button" class="aplayer-icon aplayer-icon-volume-down">\n ',t+=o.volumeDown,t+='\n </button>\n <div class="aplayer-volume-bar-wrap">\n <div class="aplayer-volume-bar">\n <div class="aplayer-volume" style="height: 80%; background: ',t+=i(r.theme),t+=';"></div>\n </div>\n </div>\n </div>\n ',r.audio.length>1&&(t+='\n <button type="button" class="aplayer-icon aplayer-icon-order">\n ',"list"===r.order?t+=o.orderList:"random"===r.order&&(t+=o.orderRandom),t+="\n </button>\n "),t+='\n <button type="button" class="aplayer-icon aplayer-icon-loop">\n ',"one"===r.loop?t+=o.loopOne:"all"===r.loop?t+=o.loopAll:"none"===r.loop&&(t+=o.loopNone),t+='\n </button>\n <button type="button" class="aplayer-icon aplayer-icon-menu">\n ',t+=o.menu,t+='\n </button>\n </div>\n </div>\n</div>\n<div class="aplayer-list',r.listFolded&&(t+=" aplayer-list-hide"),t+='"',r.listMaxHeight&&(t+=' style="max-height: ',t+=i(r.listMaxHeight),t+='"'),t+=">\n <ol>\n ",s(r.audio,function(e,n){t+='\n <li>\n <span class="aplayer-list-cur" style="background: ',t+=i(r.theme),t+=';"></span>\n <span class="aplayer-list-index">',t+=i(n+1),t+='</span>\n <span class="aplayer-list-title">',t+=i(e.name),t+='</span>\n <span class="aplayer-list-author">',t+=i(e.artist),t+="</span>\n </li>\n "}),t+="\n </ol>\n</div>"}},function(e,t,n){"use strict";(function(t){function a(e){return"string"!=typeof e&&(e=void 0===e||null===e?"":"function"==typeof e?a(e.call(e)):JSON.stringify(e)),e}function i(e){var t=""+e,n=s.exec(t);if(!n)return e;var a="",i=void 0,o=void 0,r=void 0;for(i=n.index,o=0;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&#34;";break;case 38:r="&#38;";break;case 39:r="&#39;";break;case 60:r="&#60;";break;case 62:r="&#62;";break;default:continue}o!==i&&(a+=t.substring(o,i)),o=i+1,a+=r}return o!==i?a+t.substring(o,i):a}var o=n(27),r=Object.create(o?t:window),s=/["&'<>]/;r.$escape=function(e){return i(a(e))},r.$each=function(e,t){if(Array.isArray(e))for(var n=0,a=e.length;n<a;n++)t(e[n],n);else for(var i in e)t(e[i],i)},e.exports=r}).call(t,n(1))},function(e,t,n){"use strict";(function(t){e.exports=!1;try{e.exports="[object process]"===Object.prototype.toString.call(t.process)}catch(e){}}).call(t,n(1))},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=function(){function e(t){a(this,e),this.elements={},this.elements.volume=t.volume,this.elements.played=t.played,this.elements.loaded=t.loaded}return i(e,[{key:"set",value:function(e,t,n){t=Math.max(t,0),t=Math.min(t,1),this.elements[e].style[n]=100*t+"%"}},{key:"get",value:function(e,t){return parseFloat(this.elements[e].style[t])/100}}]),e}();t.default=o},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t){a(this,e),this.storageName={volume:"aplayer-volume"},this.default={volume:t.options.volume||.7},this.data={},this.init()}return i(e,[{key:"init",value:function(){for(var e in this.storageName){var t=this.storageName[e];this.data[e]=parseFloat(r.default.storage.get(t)||this.default[e])}}},{key:"get",value:function(e){return this.data[e]}},{key:"set",value:function(e,t){this.data[e]=t,r.default.storage.set(this.storageName[e],t)}}]),e}();t.default=s},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(31),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t){a(this,e),this.container=t.container,this.async=t.async,this.player=t.player,this.content=t.content,this.parsed=[],this.index=0,this.current=[]}return i(e,[{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||e<this.current[this.index][0]||!this.current[this.index+1]||e>=this.current[this.index+1][0])for(var t=0;t<this.current.length;t++)e>=this.current[t][0]&&(!this.current[t+1]||e<this.current[t+1][0])&&(this.index=t,this.container.style.transform="translateY("+16*-this.index+"px)",this.container.style.webkitTransform="translateY("+16*-this.index+"px)",this.container.getElementsByClassName("aplayer-lrc-current")[0].classList.remove("aplayer-lrc-current"),this.container.getElementsByTagName("p")[t].classList.add("aplayer-lrc-current"))}},{key:"switch",value:function(e){var t=this;if(!this.parsed[e])if(this.async){this.parsed[e]=[["00:00","Loading"]];var n=new XMLHttpRequest;n.onreadystatechange=function(){4===n.readyState&&(n.status>=200&&n.status<300||304===n.status?t.parsed[e]=t.parse(n.responseText):(console.log("Request was unsuccessful: "+n.status),t.parsed[e]=[["00:00","Not available"]]),t.container.innerHTML=(0,r.default)({lyrics:t.parsed[e]}),t.update(0),t.current=t.parsed[e])};var a=this.content[e];n.open("get",a,!0),n.send(null)}else this.content[e]?this.parsed[e]=this.parse(this.content[e]):this.parsed[e]=[["00:00","Not available"]];this.container.innerHTML=(0,r.default)({lyrics:this.parsed[e]}),this.update(0),this.current=this.parsed[e]}},{key:"parse",value:function(e){if(e){e=e.replace(/([^\]^\n])\[/g,function(e,t){return t+"\n["});for(var t=e.split("\n"),n=[],a=t.length,i=0;i<a;i++){var o=t[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g),r=t[i].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/g,"").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g,"").replace(/^\s+|\s+$/g,"");if(o)for(var s=o.length,l=0;l<s;l++){var u=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?]/.exec(o[l]),c=60*u[1],p=parseInt(u[2]),d=u[4]?parseInt(u[4])/(2===(u[4]+"").length?100:1e3):0,h=c+p+d;n.push([h,r])}}return n.sort(function(e,t){return e[0]-t[0]}),n}return[]}}]),e}();t.default=s},function(e,t,n){var a=n(3);e.exports=function(e){"use strict";e=e||{};var t="",n=a.$each,i=e.lyrics,o=(e.$value,e.$index,a.$escape);return n(i,function(e,n){t+="\n <p",0===n&&(t+=' class="aplayer-lrc-current"'),t+=">",t+=o(e[1]),t+="</p>\n"}),t}},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),r=n(0),s=a(r),l=n(2),u=a(l),c=function(){function e(t){i(this,e),this.player=t,this.initPlayButton(),this.initList(),this.initPlayBar(),this.player.isMultiple()&&this.initOrderButton(),this.initLoopButton(),this.initMenuButton(),s.default.isMobile||this.initVolumeButton()}return o(e,[{key:"initPlayButton",value:function(){var e=this;this.player.template.pic.addEventListener("click",function(){e.player.toggle()})}},{key:"initList",value:function(){var e=this;this.player.template.list.addEventListener("click",function(t){var n=void 0;n="LI"===t.target.tagName.toUpperCase()?t.target:t.target.parentElement;var a=parseInt(n.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;a!==e.player.playIndex?(e.player.switchAudio(a),e.player.play()):e.player.toggle()})}},{key:"initPlayBar",value:function(){var e=this,t=function(t){var n=((t.clientX||t.changedTouches[0].clientX)-s.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;n=Math.max(n,0),n=Math.min(n,1),e.player.bar.set("played",n,"width"),e.player.lrc&&e.player.lrc.update(n*e.player.audio.duration),e.player.template.ptime.innerHTML=s.default.secondToTime(n*e.player.audio.duration)},n=function n(a){document.removeEventListener(s.default.nameMap.dragEnd,n),document.removeEventListener(s.default.nameMap.dragMove,t);var i=((a.clientX||a.changedTouches[0].clientX)-s.default.getElementViewLeft(e.player.template.barWrap))/e.player.template.barWrap.clientWidth;i=Math.max(i,0),i=Math.min(i,1),e.player.bar.set("played",i,"width"),e.player.seek(e.player.bar.get("played","width")*e.player.audio.duration),e.player.timer.enable("progress")};this.player.template.barWrap.addEventListener(s.default.nameMap.dragStart,function(){e.player.timer.disable("progress"),document.addEventListener(s.default.nameMap.dragMove,t),document.addEventListener(s.default.nameMap.dragEnd,n)})}},{key:"initVolumeButton",value:function(){var e=this;this.player.template.volumeButton.addEventListener("click",function(){e.player.audio.muted?(e.player.audio.muted=!1,e.player.switchVolumeIcon(),e.player.bar.set("volume",e.player.volume(),"height")):(e.player.audio.muted=!0,e.player.switchVolumeIcon(),e.player.bar.set("volume",0,"height"))});var t=function(t){var n=1-((t.clientY||t.changedTouches[0].clientY)-s.default.getElementViewTop(e.player.template.volumeBar))/e.player.template.volumeBar.clientHeight;n=Math.max(n,0),n=Math.min(n,1),e.player.volume(n)},n=function n(a){e.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener(s.default.nameMap.dragEnd,n),document.removeEventListener(s.default.nameMap.dragMove,t);var i=1-((a.clientY||a.changedTouches[0].clientY)-s.default.getElementViewTop(e.player.template.volumeBar))/e.player.template.volumeBar.clientHeight;i=Math.max(i,0),i=Math.min(i,1),e.player.volume(i)};this.player.template.volumeBarWrap.addEventListener(s.default.nameMap.dragStart,function(){e.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener(s.default.nameMap.dragMove,t),document.addEventListener(s.default.nameMap.dragEnd,n)})}},{key:"initOrderButton",value:function(){var e=this;this.player.template.order.addEventListener("click",function(){"list"===e.player.options.order?(e.player.options.order="random",e.player.template.order.innerHTML=u.default.orderRandom):"random"===e.player.options.order&&(e.player.options.order="list",e.player.template.order.innerHTML=u.default.orderList)})}},{key:"initLoopButton",value:function(){var e=this;this.player.template.loop.addEventListener("click",function(){e.player.isMultiple()?"one"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=u.default.loopNone):"none"===e.player.options.loop?(e.player.options.loop="all",e.player.template.loop.innerHTML=u.default.loopAll):"all"===e.player.options.loop&&(e.player.options.loop="one",e.player.template.loop.innerHTML=u.default.loopOne):"one"===e.player.options.loop||"all"===e.player.options.loop?(e.player.options.loop="none",e.player.template.loop.innerHTML=u.default.loopNone):"none"===e.player.options.loop&&(e.player.options.loop="all",e.player.template.loop.innerHTML=u.default.loopAll)})}},{key:"initMenuButton",value:function(){var e=this;this.player.template.list.style.height=33*this.player.options.audio.length-1+"px",this.player.template.menu.addEventListener("click",function(){e.player.template.list.classList.contains("aplayer-list-hide")?e.player.template.list.classList.remove("aplayer-list-hide"):e.player.template.list.classList.add("aplayer-list-hide")})}}]),e}();t.default=c},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=n(0),r=function(e){return e&&e.__esModule?e:{default:e}}(o),s=function(){function e(t){a(this,e),this.player=t,window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),this.types=["loading","progress"],this.init()}return i(e,[{key:"init",value:function(){var e=this;this.types.map(function(t){return e["init"+t+"Checker"](),t})}},{key:"initprogressChecker",value:function(){var e=this;this.progressChecker=setInterval(function(){if(e.enableprogressChecker){e.player.bar.set("played",e.player.audio.currentTime/e.player.audio.duration,"width"),e.player.lrc&&e.player.lrc.update();var t=r.default.secondToTime(e.player.audio.currentTime);e.player.template.ptime.innerHTML!==t&&(e.player.template.ptime.innerHTML=t)}},100)}},{key:"initloadingChecker",value:function(){var e=this,t=0,n=0,a=!1;this.loadingChecker=setInterval(function(){e.enableloadingChecker&&(n=e.player.audio.currentTime,a||n!==t||e.player.audio.paused||(e.player.container.classList.add("aplayer-loading"),a=!0),a&&n>t&&!e.player.audio.paused&&(e.player.container.classList.remove("aplayer-loading"),a=!1),t=n)},100)}},{key:"enable",value:function(e){this["enable"+e+"Checker"]=!0,"fps"===e&&this.initfpsChecker()}},{key:"disable",value:function(e){this["enable"+e+"Checker"]=!1}},{key:"destroy",value:function(){var e=this;this.types.map(function(t){return e["enable"+t+"Checker"]=!1,e[t+"Checker"]&&clearInterval(e[t+"Checker"]),t})}}]),e}();t.default=s},function(e,t,n){"use strict";function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),o=function(){function e(){a(this,e),this.events={},this.audioEvents=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","mozaudioavailable","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],this.playerEvents=["destroy","switchaudio","addaudio","removeaudio"]}return i(e,[{key:"on",value:function(e,t){this.type(e)&&"function"==typeof t&&(this.events[e]||(this.events[e]=[]),this.events[e].push(t))}},{key:"trigger",value:function(e,t){if(this.events[e]&&this.events[e].length)for(var n=0;n<this.events[e].length;n++)this.events[e][n](t)}},{key:"type",value:function(e){return-1!==this.playerEvents.indexOf(e)?"player":-1!==this.audioEvents.indexOf(e)?"audio":(console.error("Unknown event name: "+e),null)}}]),e}();t.default=o}]).default});
//# sourceMappingURL=APlayer.min.js.map