UNPKG

vue-cplayer

Version:

A simple vue wrapper for [cPlayer](https://github.com/MoePlayer/cPlayer).

26 lines (21 loc) 59.5 kB
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var cplayer = createCommonjsModule(function (module, exports) { !function(e,t){module.exports=t();}(commonjsGlobal,function(){return function(e){function t(i){if(n[i]){ return n[i].exports; }var o=n[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i});},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=3)}([function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}function o(e,t,n,i){var o=void 0,r=!1;return t.forEach(function(t,n){a.default(t,e)&&(o=n);}),void 0!==o&&(t.splice(o,1),n>o?(n--,r=!1):n===o&&(n=i(n),r=!0)),{playlist:t,nowpoint:n,needupdate:r}}var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var a=n(6);t.baseRemoveMusic=o;var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,e),this.__playlist=[],this.point=0,this.__playlist=t,this.to(n);}return r(e,[{key:"next",value:function(){return this.point=this.nextPoint(),this.playlist[this.point]}},{key:"prev",value:function(){return this.point=this.prevPoint(),this.playlist[this.point]}},{key:"now",value:function(){return this.playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1));}},{key:"addMusic",value:function(e){this.__playlist.push(e);}},{key:"nextPoint",value:function(){var e=this.point+1;return e>=this.__playlist.length&&(e=0),e}},{key:"prevPoint",value:function(){var e=this.point-1;return e<0&&(e=this.__playlist.length-1),e}},{key:"removeMusic",value:function(e){var t=this,n=o(e,this.__playlist,this.point,function(e){return Math.max(0,Math.min(e,t.__playlist.length-1))}),i=n.playlist,r=n.nowpoint,a=n.needupdate;return this.__playlist=i,this.point=r,a}},{key:"playlist",get:function(){return this.__playlist}}]),e}();t.listloopPlaymode=l;},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0;}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function r(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e)){ throw TypeError("n must be a positive number"); }return this._maxListeners=e,this},n.prototype.emit=function(e){ var this$1 = this; var t,n,o,l,s,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error){ throw t; }var p=new Error('Uncaught, unspecified "error" event. ('+t+")");throw p.context=t,p}if(n=this._events[e],a(n)){ return!1; }if(i(n)){ switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:l=Array.prototype.slice.call(arguments,1),n.apply(this,l);} }else if(r(n)){ for(l=Array.prototype.slice.call(arguments,1),c=n.slice(),o=c.length,s=0;s<o;s++){ c[s].apply(this$1,l); } }return!0},n.prototype.addListener=function(e,t){var o;if(!i(t)){ throw TypeError("listener must be a function"); }return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?r(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,r(this._events[e])&&!this._events[e].warned&&(o=a(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&o>0&&this._events[e].length>o&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),o||(o=!0,t.apply(this,arguments));}if(!i(t)){ throw TypeError("listener must be a function"); }var o=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,o,a,l;if(!i(t)){ throw TypeError("listener must be a function"); }if(!this._events||!this._events[e]){ return this; }if(n=this._events[e],a=n.length,o=-1,n===t||i(n.listener)&&n.listener===t){ delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t); }else if(r(n)){for(l=a;l-- >0;){ if(n[l]===t||n[l].listener&&n[l].listener===t){o=l;break} }if(o<0){ return this; }1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t);}return this},n.prototype.removeAllListeners=function(e){ var this$1 = this; var t,n;if(!this._events){ return this; }if(!this._events.removeListener){ return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this; }if(0===arguments.length){for(t in this$1._events){ "removeListener"!==t&&this$1.removeAllListeners(t); }return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n)){ this.removeListener(e,n); }else if(n){ for(;n.length;){ this$1.removeListener(e,n[n.length-1]); } }return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t)){ return 1; }if(t){ return t.length }}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)};},function(e,t){e.exports="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAiACIDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QALhAAAgEDAwIFAwMFAAAAAAAAAQIDAAQRBRIhE0EGIjFRkRQzYTI1cXOBocHR/8QAGAEAAwEBAAAAAAAAAAAAAAAAAQIDBAX/xAAiEQACAQMCBwAAAAAAAAAAAAAAAQIDETESFAQhIkFRYWL/2gAMAwEAAhEDEQA/AGBo7mOKMEBjgc4rqLaRWXG1fgUttA1qNbnpPdGV5mIRRhkiKgeTjkE5J5/1W9pniH6jVbuPdiO2gJwHG13B5wcc44+a5tPpNM4N3OwlC45RfgVlXMA2t5E/nFVZ/EEaWVlcmJmjuDHnDAdIP6MR3GSBx71Fe37LbSSKylVIyNwyM002IotGc2N7cr6+1FYTXu5iepKcnP66KzF9AoBfQ2LmzgWWJp3L72A8rNt2kY5x/wBrtfD+oSXkQ6k8iQSRuJVjwr78DcATx6YyfYehNcbsttTkayGoiGcPuh3REo2FG0bt2R6e3fvVW2vulYSSMPND9vk46jcA/Ab/ABXTlBSXsCnpvfAydb8TR3eg7bMrGrStB1c8r0wTsP4PDKe/OeRUXiPxFLBojump6fFcTtGFeCTDHaoJyMe5A70uYte+n097Z7eK6EjA4mJCptXAK7SOcE1S1a9jvbqNoYzFCkSIiFtxGBzk9znvQXD81cV1kkMSAWDQRt9bMuVB272OOPTOKKVu4+5+aKO2+gbleC5bfusf9U1ctlB1RYiAYy/Kn0P9qKKtLIkMGfeKBdkAADjgVFcffYdgcD8UUU6JPuR0UUURT//Z";},function(e,t,n){e.exports=n(4);},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}function o(e,t){if(!e){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t){ throw new TypeError("Super expression must either be null or a function, not "+typeof t); }e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t);}function a(e){return e.map(function(e,t){var n=Object.assign({},e);return"string"==typeof e.lyric&&(n.lyric=p.decodeLyricStr(e.lyric)),"string"==typeof e.sublyric&&(n.sublyric=p.decodeLyricStr(e.sublyric)),n})}var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0}),n(5);var s=n(0),c=n(1),p=n(7),u=n(8),h=n(9),d=n(10),y=void 0;y=n(11).default;var m={playlist:[],point:0,volume:1,playmode:"listloop",autoplay:!1},f={listloop:s.listloopPlaymode,singlecycle:u.singlecyclePlaymode,listrandom:h.listrandomPlaymode},v=function(e){function t(e){i(this,t);var n=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.__paused=!0,n.playmodeName="listloop",n.eventHandlers={handlePlay:function(){n.__paused&&n.pause();},handleVolumeChange:function(){n.emit("volumechange",n.audioElement.volume);},handleTimeUpdate:function(){var e=n.audioElement.duration,t=n.audioElement.currentTime;n.emit("timeupdate",t,e);},handleCanPlayThrough:function(){ var arguments$1 = arguments; for(var e=arguments.length,t=Array(e),i=0;i<e;i++){ t[i]=arguments$1[i]; }n.emit.apply(n,["canplaythrough"].concat(t));},handlePause:function(){n.__paused||n.audioElement.ended||n.play();},handleEnded:function(){ var arguments$1 = arguments; for(var e=arguments.length,t=Array(e),i=0;i<e;i++){ t[i]=arguments$1[i]; }n.__paused||n.next(),n.emit.apply(n,["ended"].concat(t));},handlePlayListChange:function(){ var arguments$1 = arguments; for(var e=arguments.length,t=Array(e),i=0;i<e;i++){ t[i]=arguments$1[i]; }n.emit.apply(n,["playlistchange"].concat(t));},handlePlaymodeChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.mode;n.emit("playmodechange",e);}},e=Object.assign({},m,e),n.audioElement=new Audio,n.audioElement.loop=!1,n.audioElement.autoplay=!1,n.initializeEventEmitter(),n.playmode=new f[e.playmode](a(e.playlist),e.point),n.view=new y(n,e),n.openAudio(),n.eventHandlers.handlePlaymodeChange(),n.setVolume(e.volume),e.autoplay&&n.playlist.length>0&&n.play(),d.cplayerMediaSessionPlugin(n),n}return r(t,e),l(t,[{key:"initializeEventEmitter",value:function(){this.audioElement.addEventListener("volumechange",this.eventHandlers.handleVolumeChange),this.audioElement.addEventListener("timeupdate",this.eventHandlers.handleTimeUpdate),this.audioElement.addEventListener("canplaythrough",this.eventHandlers.handleCanPlayThrough),this.audioElement.addEventListener("pause",this.eventHandlers.handlePause),this.audioElement.addEventListener("play",this.eventHandlers.handlePlay),this.audioElement.addEventListener("ended",this.eventHandlers.handleEnded),this.audioElement.addEventListener("loadeddata",this.eventHandlers.handleLoadeddata);}},{key:"isPlaying",value:function(){return this.audioElement.currentTime>0&&!this.audioElement.paused&&!this.audioElement.ended&&this.audioElement.readyState>2}},{key:"openAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.nowplay;e&&(this.audioElement.src=this.nowplay.src,this.emit("openaudio",e));}},{key:"toggleMode",value:function(){switch(this.playmodeName){case"listloop":this.setMode("singlecycle");break;case"singlecycle":this.setMode("listrandom");break;case"listrandom":this.setMode("listloop");}}},{key:"setMode",value:function(e){"string"==typeof e&&this.playmodeName!==e&&f[e]&&(this.playmode=new f[e](this.playlist,this.nowplaypoint),this.playmodeName=e,this.eventHandlers.handlePlaymodeChange());}},{key:"getMode",value:function(){return this.mode}},{key:"play",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(!this.isPlaying()&&this.playlist.length>0||e)&&(this.audioElement.play(),(!1===this.audioElement.paused||e)&&(this.__paused=!1,this.emit("playstatechange",this.__paused),this.emit("play")));}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];(this.isPlaying()&&this.playlist.length>0||e)&&(this.audioElement.pause(),!0===this.audioElement.paused&&(this.__paused=!0,this.emit("playstatechange",this.__paused),this.emit("pause")));}},{key:"to",value:function(e){this.playmode.to(e),this.openAudio(),this.play();}},{key:"next",value:function(){this.playmode.next(),this.openAudio(),this.play();}},{key:"prev",value:function(){this.playmode.prev(),this.openAudio(),this.play();}},{key:"togglePlayState",value:function(){this.__paused?this.play():this.pause();}},{key:"add",value:function(e){e=a([e])[0],this.playmode.addMusic(e),this.eventHandlers.handlePlayListChange(),1===this.playlist.length&&this.to(0);}},{key:"remove",value:function(e){var t=this.playmode.removeMusic(e);this.eventHandlers.handlePlayListChange(),t&&(this.openAudio(),this.__paused?this.pause():this.play());}},{key:"setVolume",value:function(e){this.audioElement.volume=Math.max(0,Math.min(1,e));}},{key:"destroy",value:function(){var e=this;this.audioElement.src=null,this.audioElement.removeEventListener("timeupdate",this.eventHandlers.handleTimeUpdate),this.removeAllListeners(),this.view&&this.view.destroy(),Object.getOwnPropertyNames(this).forEach(function(t){return delete e[t]}),this.__proto__=Object;}},{key:"mode",set:function(e){this.setMode(e);},get:function(){return this.playmodeName}},{key:"volume",set:function(e){this.setVolume(e);}},{key:"playlist",get:function(){return this.playmode.playlist}},{key:"nowplay",get:function(){return this.playmode&&this.playmode.now()}},{key:"nowplaypoint",get:function(){return this.playmode&&this.playmode.nowpoint()}},{key:"played",get:function(){return!this.__paused}},{key:"paused",get:function(){return this.__paused}}]),t}(c.EventEmitter);t.default=v;var g=function(){Array.prototype.forEach.call(document.querySelectorAll("template[cplayer]"),function(e){e.attributes.getNamedItem("loaded")||new v(Object.assign({generateBeforeElement:!0,deleteElementAfterGenerate:!0,element:e},JSON.parse(e.innerHTML)));});};window.addEventListener("load",g),window.cplayer=v;},function(e,t,n){"use strict";"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){ var arguments$1 = arguments; if(null==e){ throw new TypeError("Cannot convert undefined or null to object"); }for(var n=Object(e),i=1;i<arguments.length;i++){var o=arguments$1[i];if(null!=o){ for(var r in o){ Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r]); } }}return n},writable:!0,configurable:!0});},function(e,t,n){"use strict";function i(e,t){return e==t?0!=e||0!=t||1/e==1/t:e!=e&&t!=t}function o(e,t){if(i(e,t)){ return!0; }if("object"!==(void 0===e?"undefined":r(e))||null===e||"object"!==(void 0===t?"undefined":r(t))||null===t){ return!1; }var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length){ return!1; }for(var l=0;l<n.length;l++){ if(!a.call(t,n[l])||!i(e[n[l]],t[n[l]])){ return!1; } }return!0}var r="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};Object.defineProperty(t,"__esModule",{value:!0});var a=Object.prototype.hasOwnProperty;t.default=o;},function(e,t,n){"use strict";function i(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)}function o(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}function r(e,t){if("string"!=typeof e){ return e; }var n=[];return e.replace(/\n+/gi,"\n").trim().split("\n").forEach(function(e){n.push.apply(n,i(a(e)));}),new s(n,e)}function a(e){var t=[],n=e.match(/\[\d+\:[\.\d]+\]/gi),i=/(?:\[\d+\:[\.\d]+\])*(.*)/gi.exec(e)[1].trim();return n&&i&&n.forEach(function(e){var n=/\[(\d+)\:([\.\d]+)\]/gi.exec(e.trim()),o=60*parseInt(n[1])*1e3+1e3*parseFloat(n[2]);t.push({time:o,word:i});}),t}var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(t,n){o(this,e),this.items=[],this.items=t,this.raw=n;}return l(e,[{key:"getLyric",value:function(e){return this.items.reduce(function(t,n){return n.time<e&&(!t||t.time<n.time)?n:t},void 0)}},{key:"getNextLyric",value:function(e){return this.items.reduce(function(t,n){return n.time>e&&(!t||t.time>n.time)?n:t},void 0)}},{key:"toString",value:function(){return this.raw}}]),e}();t.Lyric=s,t.decodeLyricStr=r,t.decodeLyricStrItem=a;},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,e),this.__playlist=[],this.__playlist=t,this.to(n);}return o(e,[{key:"next",value:function(){return this.__playlist[this.point]}},{key:"prev",value:function(){return this.__playlist[this.point]}},{key:"now",value:function(){return this.__playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1));}},{key:"addMusic",value:function(e){this.__playlist.push(e);}},{key:"removeMusic",value:function(e){var t=this,n=r.baseRemoveMusic(e,this.__playlist,this.point,function(e){return Math.max(0,Math.min(e,t.__playlist.length-1))}),i=n.playlist,o=n.nowpoint,a=n.needupdate;return this.__playlist=i,this.point=o,a}},{key:"playlist",get:function(){return this.__playlist}}]),e}();t.singlecyclePlaymode=a;},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;i(this,e),this.__playlist=[],this.point=0,this.__playlist=t,this.to(n);}return o(e,[{key:"next",value:function(){return this.point=this.randomPoint(),this.__playlist[this.point]}},{key:"prev",value:function(){return this.point=this.randomPoint(),this.__playlist[this.point]}},{key:"now",value:function(){return this.__playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1));}},{key:"addMusic",value:function(e){this.__playlist.push(e);}},{key:"randomPoint",value:function(){if(this.__playlist.length>1){var e=Math.floor(this.__playlist.length*Math.random());return e===this.point?this.randomPoint():e}return 0}},{key:"removeMusic",value:function(e){var t=this,n=r.baseRemoveMusic(e,this.__playlist,this.point,function(e){return t.randomPoint()}),i=n.playlist,o=n.nowpoint,a=n.needupdate;return this.__playlist=i,this.point=o,a}},{key:"playlist",get:function(){return this.__playlist}}]),e}();t.listrandomPlaymode=a;},function(e,t,n){"use strict";function i(e){"mediaSession"in navigator&&(navigator.mediaSession.metadata=o(e.nowplay),navigator.mediaSession.setActionHandler("play",function(){return e.play()}),navigator.mediaSession.setActionHandler("pause",function(){return e.pause()}),navigator.mediaSession.setActionHandler("previoustrack",function(){return e.prev()}),navigator.mediaSession.setActionHandler("nexttrack",function(){return e.next()}),e.on("openaudio",function(){navigator.mediaSession.metadata=o(e.nowplay);}));}function o(e){return new MediaMetadata({title:e.name,artist:e.artist,album:e.album,artwork:[{src:e.poster||r}]})}Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);t.cplayerMediaSessionPlugin=i,t.mediaMetadata=o;},function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t)){ throw new TypeError("Cannot call a class as a function") }}function o(e,t){if(!e){ throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); }return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t){ throw new TypeError("Super expression must either be null or a function, not "+typeof t); }e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t);}function a(e){for(var t="",n=!1,i=0;i<e.length;i++){var o=e.charAt(i),r=/[ぁ-んァ-ン]/.test(o);r&&!n&&(t+='<span class="cp-lyric-text-zoomout">',n=!0),!r&&n&&(t+="</span>",n=!1),t+=o;}return n&&(t+="</span>"),t}function l(e,t){return(arguments.length>2&&void 0!==arguments[2]&&arguments[2]?a(e):e)+(t?'<span class="cp-lyric-text-sub">'+t+"</span>":"")}function s(e){var t=document.createElement("style");return t.id="cplayer-style",t.innerHTML=e,t}function c(e,t,n){var i=e.createShadowRoot();return i.innerHTML=t,i.appendChild(s(n)),i.firstChild}function p(e,t,n){var i=document.createElement("div");return i.innerHTML=t,e.parentNode.insertBefore(i,e),document.getElementById("cplayer-style")||document.body.appendChild(s(n)),i.firstChild}function u(e,t,n){var i=document.createElement("div"),o=i.createShadowRoot();return o.innerHTML=t,o.appendChild(s(n)),e.parentNode.insertBefore(i,e),o.firstChild}function h(e,t,n){return e.innerHTML=t,console.log(n),document.getElementById("cplayer-style")||document.body.appendChild(s(n)),e.firstChild}var d=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i);}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();Object.defineProperty(t,"__esModule",{value:!0});var y=n(12),m=n(1),f=n(2),v=n(13),g=n(14),w=n(15),b={element:document.body,generateBeforeElement:!1,deleteElementAfterGenerate:!1,zoomOutKana:!1,showPlaylist:!1,showPlaylistButton:!0,dropDownMenuMode:"bottom",width:"",size:"12px",style:""},k=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return r.elementLinks=y.default(r.getElementLinks),r.dropDownMenuShowInfo=!0,r.__OldVolume=1,r.__OldLyric="",r.__OldTotalTime=0,r.handlePlaylistchange=function(){r.updatePlaylist();},r.handleClickListButton=function(){r.toggleDropDownMenu();},r.handleClickModeButton=function(){r.player.toggleMode();},r.handleClickPlayList=function(e,t){r.player.nowplaypoint!==e&&r.player.to(e);},r.handleClickPlayButton=function(){r.player.togglePlayState();},r.handleClickVolumeButton=function(){r.toggleVolumeControllerKeepShow();},r.handleOpenAudio=function(e){r.setPoster(e.poster||f),r.setProgress(0),r.elementLinks.title.innerText=e.name,r.elementLinks.artist.innerText=e.artist||"",r.updateLyric(),r.updatePlaylist();},r.handleModeChange=function(e){r.setMode(e);},r.handleVolumeChange=function(e){r.setVolume(e);},r.handleTimeUpdate=function(e,t){r.setProgress(e/t),r.updateLyric(e);},r.handleClickPrevButton=function(){r.player.prev();},r.handleClickNextButton=function(){r.player.next();},r.handlePlayStateChange=function(e){r.setPlayIcon(e);},r.handleMouseVolumeController=function(e){if(r.removeVolumeControllerKeepShow(),1===e.buttons){var t=Math.max(0,Math.min(1,(e.clientX-r.elementLinks.volumeController.getBoundingClientRect().left)/r.elementLinks.volumeController.clientWidth));r.player.setVolume(t),r.setVolume(t);}},r.handleTouchVolumeController=function(e){r.removeVolumeControllerKeepShow();var t=Math.max(0,Math.min(1,(e.targetTouches[0].clientX-r.elementLinks.volumeController.getBoundingClientRect().left)/r.elementLinks.volumeController.clientWidth));r.player.setVolume(t),r.setVolume(t);},r.options=Object.assign({},b,n),r.player=e,r.options.generateBeforeElement?r.options.element.createShadowRoot?r.rootElement=u(r.options.element,v,w+r.options.style):r.rootElement=p(r.options.element,v,w+r.options.style):r.options.element.createShadowRoot?r.rootElement=c(r.options.element,v,w+r.options.style):r.rootElement=h(r.options.element,v,w+r.options.style),n.deleteElementAfterGenerate&&n.element.parentElement.removeChild(n.element),r.rootElement.style.width=r.options.width,r.rootElement.style.fontSize=r.options.size,r.elementLinks=r.getElementLinks(),r.injectEventListener(),r.setPlayIcon(r.player.paused),r.dropDownMenuShowInfo=!r.options.showPlaylist,r.dropDownMenuShowInfo?r.showInfo():r.showPlaylist(),r.options.showPlaylistButton?r.elementLinks.button.list.style.display="":r.elementLinks.button.list.style.display="none",r.elementLinks.dropDownMenu.classList.add("cp-drop-down-menu-"+r.options.dropDownMenuMode),r}return r(t,e),d(t,[{key:"getRootElement",value:function(){return this.rootElement}},{key:"getPlayListLinks",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rootElement).querySelectorAll(".cp-playlist li")}},{key:"getElementLinks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rootElement,t=function(t){return e.getElementsByClassName(t)[0]};return{icon:{play:t("cp-play-icon"),mode:t("cp-mode-icon")},button:{prev:t("cp-prev-button"),play:t("cp-play-button"),next:t("cp-next-button"),volume:t("cp-volume-icon"),list:t("cp-list-button"),mode:t("cp-mode-button")},progress:t("cp-progress-fill"),poster:t("cp-poster"),title:t("cp-audio-title"),artist:t("cp-audio-artist"),lyric:t("cp-lyric-text"),lyricContainer:t("cp-lyric"),volumeController:t("cp-volume-controller"),volumeFill:t("cp-volume-fill"),volumeControllerButton:t("cp-volume-controller-button"),volumeControllerContainer:t("cp-volume-container"),dropDownMenu:t("cp-drop-down-menu"),playlist:t("cp-playlist"),playlistItems:this.getPlayListLinks(e)}}},{key:"setPlayIcon",value:function(e){e?this.elementLinks.icon.play.classList.add("cp-play-icon-paused"):this.elementLinks.icon.play.classList.remove("cp-play-icon-paused");}},{key:"setProgress",value:function(e){this.elementLinks.progress.style.transform="translateX(-"+(100-100*e)+"%)";}},{key:"setPoster",value:function(e){this.elementLinks.poster.style.backgroundImage='url("'+e+'")';}},{key:"setVolume",value:function(e){this.__OldVolume!==e&&(this.elementLinks.volumeFill.style.width=100*e+"%",this.elementLinks.volumeControllerButton.style.right=100*(1-e)+"%",this.__OldVolume=e);}},{key:"setMode",value:function(e){var t=document.createAttribute("data-mode");t.value=e,this.elementLinks.button.mode.attributes.setNamedItem(t);}},{key:"showInfo",value:function(){var e=this.elementLinks.dropDownMenu;e.style.height="",e.classList.remove("cp-drop-down-menu-playlist"),e.classList.add("cp-drop-down-menu-info"),this.dropDownMenuShowInfo=!0;}},{key:"showPlaylist",value:function(){var e=this.elementLinks.dropDownMenu;e.style.height=25*this.player.playlist.length+"px",e.classList.remove("cp-drop-down-menu-info"),e.classList.add("cp-drop-down-menu-playlist"),this.dropDownMenuShowInfo=!1;}},{key:"toggleDropDownMenu",value:function(){this.dropDownMenuShowInfo?this.showPlaylist():this.showInfo();}},{key:"setVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.add("cp-volume-container-show");}},{key:"toggleVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.toggle("cp-volume-container-show");}},{key:"removeVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.remove("cp-volume-container-show");}},{key:"setLyric",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.__OldLyric!==e||this.__OldTotalTime!==n){if(this.elementLinks.lyric.innerHTML=e,this.elementLinks.lyric.style.transition="",this.elementLinks.lyric.style.transform="",0!==n){var i=this.elementLinks.lyric.clientWidth,o=this.elementLinks.lyricContainer.clientWidth;if(i>o){var r=n-t,a=i-o,l=o/i*r,s=Math.min(.6*l,r),c=r-l;this.elementLinks.lyric.style.transition="transform "+c+"ms linear "+s+"ms",this.elementLinks.lyric.style.transform="translateX(-"+a+"px)";}}this.__OldLyric=e,this.__OldTotalTime=n;}}},{key:"updatePlaylist",value:function(){var e=this,t=this.player.playlist.map(function(t,n){var i=document.createElement("li");return i.innerHTML="\n "+(n===e.player.nowplaypoint?g:'<span class="cp-play-icon"></span>')+"\n <span>"+t.name+"</span><span class='cp-playlist-artist'>"+(t.artist?" - "+t.artist:"")+"</span>\n ",i});this.elementLinks.playlist.innerHTML="",t.forEach(function(t){e.elementLinks.playlist.appendChild(t);}),this.elementLinks.playlistItems=this.getPlayListLinks(),this.injectPlayListEventListener(),this.dropDownMenuShowInfo||(this.elementLinks.dropDownMenu.style.height=25*this.player.playlist.length+"px");}},{key:"injectPlayListEventListener",value:function(){var e=this;Array.prototype.forEach.call(this.elementLinks.playlistItems,function(t,n){t.addEventListener("click",function(t){e.handleClickPlayList(n,t);});});}},{key:"injectEventListener",value:function(){this.elementLinks.button.play.addEventListener("click",this.handleClickPlayButton),this.elementLinks.button.prev.addEventListener("click",this.handleClickPrevButton),this.elementLinks.button.next.addEventListener("click",this.handleClickNextButton),this.elementLinks.button.volume.addEventListener("click",this.handleClickVolumeButton),this.elementLinks.button.list.addEventListener("click",this.handleClickListButton),this.elementLinks.button.mode.addEventListener("click",this.handleClickModeButton),this.elementLinks.volumeController.addEventListener("mousemove",this.handleMouseVolumeController),this.elementLinks.volumeController.addEventListener("mousedown",this.handleMouseVolumeController),this.elementLinks.volumeController.addEventListener("touchmove",this.handleTouchVolumeController,{passive:!0}),this.player.addListener("playstatechange",this.handlePlayStateChange),this.player.addListener("timeupdate",this.handleTimeUpdate),this.player.addListener("openaudio",this.handleOpenAudio),this.player.addListener("volumechange",this.handleVolumeChange),this.player.addListener("playmodechange",this.handleModeChange),this.player.addListener("playlistchange",this.handlePlaylistchange),this.injectPlayListEventListener();}},{key:"updateLyric",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.player.nowplay.lyric&&"string"!=typeof this.player.nowplay.lyric&&this.player.played){var t=this.player.nowplay.lyric.getLyric(1e3*e),n=this.player.nowplay.lyric.getNextLyric(1e3*e);if(t){var i=void 0;if(this.player.nowplay.sublyric&&"string"!=typeof this.player.nowplay.sublyric&&(i=this.player.nowplay.sublyric.getLyric(1e3*e)),n){var o=n.time-t.time,r=1e3*e-t.time;this.setLyric(l(t.word,i?i.word:void 0,this.options.zoomOutKana),r,o);}else{var a=this.player.audioElement.duration-t.time,s=1e3*e-t.time;this.setLyric(l(t.word,i?i.word:void 0,this.options.zoomOutKana),s,a);}}else { this.setLyric(l(this.player.nowplay.name,this.player.nowplay.artist,!1),1e3*e,n.time); }}else { this.setLyric(l(this.player.nowplay.name,this.player.nowplay.artist,!1)); }}},{key:"destroy",value:function(){this.rootElement.parentElement.removeChild(this.rootElement);}}]),t}(m.EventEmitter);t.default=k;},function(e,t,n){"use strict";function i(e){return{}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;},function(e,t){e.exports='<c-player loaded> <div class=cp-mainbody> <div class=cp-poster> </div> <div class=cp-center-container> <div class=cp-controls> <a class=cp-prev-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class=cp-prev-icon viewBox="0 0 1024 1024" version=1.1> <path d="M943.705 11.8c10.321 5.183 17.325 15.601 17.534 27.675l-0.004 938.318c-0.167 12.186-7.229 22.684-17.457 27.782-4.857 2.548-10.527 4.026-16.543 4.026a35.75 35.75 0 0 1-18.217-4.955l-716.617-469c-9.689-5.299-16.151-15.421-16.151-27.053 0-11.63 6.462-21.753 15.991-26.972L909.186 12.666c5.177-3.048 11.404-4.848 18.052-4.848a35.878 35.878 0 0 1 16.665 4.077z"/> <path d="M228.435 77.809v868.712c-3.889 42.573-39.416 75.664-82.673 75.664s-78.784-33.091-82.649-75.34l-0.024-869.036C65.9 34.259 101.911 0 145.924 0s80.024 34.259 82.822 77.564z"/> </svg> </a> <a class=cp-play-button> <span class="cp-play-icon cp-play-icon-paused"> <div class=cp-play-icon-left></div> <div class=cp-play-icon-right></div> <div class=cp-play-icon-triangle-1></div> <div class=cp-play-icon-triangle-2></div> </span> </a> <a class=cp-next-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class=cp-next-icon viewBox="0 0 1024 1024" version=1.1> <path d="M943.705 11.8c10.321 5.183 17.325 15.601 17.534 27.675l-0.004 938.318c-0.167 12.186-7.229 22.684-17.457 27.782-4.857 2.548-10.527 4.026-16.543 4.026a35.75 35.75 0 0 1-18.217-4.955l-716.617-469c-9.689-5.299-16.151-15.421-16.151-27.053 0-11.63 6.462-21.753 15.991-26.972L909.186 12.666c5.177-3.048 11.404-4.848 18.052-4.848a35.878 35.878 0 0 1 16.665 4.077z"/> <path d="M228.435 77.809v868.712c-3.889 42.573-39.416 75.664-82.673 75.664s-78.784-33.091-82.649-75.34l-0.024-869.036C65.9 34.259 101.911 0 145.924 0s80.024 34.259 82.822 77.564z"/> </svg> </a> </div> <div class=cp-lyric> <span class=cp-lyric-text></span> </div> </div> <a class=cp-volume-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-volume-icon cp-icon-dark" viewBox="0 200 1024 650" version=1.1> <path d="M607.869008 364.026176l-49.340512 49.340528c25.412064 25.160448 41.150352 60.055392 41.150352 98.637648 0 38.573568-15.738288 73.477184-41.150352 98.62896l49.340512 49.340512c37.836112-37.888176 61.244-90.195872 61.244-147.969488 0-57.782272-23.407888-110.081328-61.244-147.978176z"/> <path d="M807.937968 512c0-96.086912-39.050752-183.055296-102.134064-245.904368L656.95792 314.9416c50.398992 50.45104 81.563248 120.1108 81.563248 197.0584 0 76.938912-31.172944 146.598672-81.563248 197.0584l48.845984 48.845968C768.887216 695.055296 807.937968 608.086896 807.937968 512z"/> <path d="M946.780288 512.004336c0-134.434896-54.598176-256.107376-142.807248-344.082192l-49.088912 49.088896c75.65488 75.411952 122.470672 179.732384 122.470672 294.993296 0 115.252224-46.815792 219.581328-122.470672 294.984608l49.088912 49.088912c88.209072-87.966144 142.807248-209.647312 142.807248-344.07352z"/> <path d="M247.605111 659.304938 458.566804 854.551527 458.566804 169.448479 251.58222 364.704275 53.490893 364.704275 53.490893 659.304938Z"/> </svg> <div class=cp-volume-container> <div> <span class=cp-volume-controller> <span class=cp-volume-fill></span> <span class=cp-volume-controller-button></span> </span> </div> </div> </a> <a class=cp-list-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-list-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M168.57 820.6c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.55-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89z m0-284.33c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89z m0-286.72c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89zM969 820.6c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z m0-284.33c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z m0-286.72c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z"/> </svg> </a> <a class=cp-mode-button data-mode=listloop> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-loop-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M157 624c17.3-4.8 27.4-22.7 22.6-40-5.4-19.4-8.1-39.5-8.1-59.9 0-123.1 100.1-223.2 223.2-223.2h302.4v57.6c0 18.5 12.9 25.6 28.6 15.9l138.6-85.8c15.7-9.7 15.9-25.9 0.3-35.9l-139.2-89.9c-15.5-10-28.2-3.1-28.2 15.4V236H394.7c-77 0-149.3 30-203.8 84.4-54.4 54.4-84.4 126.8-84.4 203.8 0 26.2 3.5 52.2 10.5 77.3 4 14.4 17.1 23.8 31.3 23.8 2.9-0.1 5.8-0.4 8.7-1.3z m748.7-202.1c-4-14.4-17.1-23.8-31.3-23.8-2.9 0-5.8 0.4-8.7 1.2-17.3 4.8-27.4 22.7-22.6 40 5.4 19.4 8.1 39.5 8.1 59.9 0 123.1-100.1 223.2-223.2 223.2H325.5v-57.6c0-18.5-12.9-25.6-28.6-15.9l-138.6 85.8c-15.7 9.7-15.9 25.9-0.3 35.9l139.2 89.9c15.5 10 28.2 3.1 28.2-15.4v-57.9h302.4c77 0 149.3-30 203.8-84.4C886 648.4 916 576 916 499c0.1-26-3.4-52-10.3-77.1z"/> </svg> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-single-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M102.5 653.9c17.3-4.8 27.4-22.7 22.6-40-5.4-19.4-8.1-43.4-8.1-63.8C117 427 217.1 323 340.2 323h132.3c1.4-20 5.4-40 11.7-60h-144c-77 0-149.4 31.4-203.8 85.8C82 403.2 52 476.3 52 553.3c0 26.2 3.5 52.6 10.5 77.6 4 14.4 17.1 24 31.3 24 2.9 0 5.8-0.2 8.7-1z m471 109.1H272v-68.3c0-18.5-13.3-25.6-29-15.9l-138.8 85.8c-15.7 9.7-16 25.9-0.5 35.9l139.7 89.9c15.5 10 28.7 3.1 28.7-15.4v-52h301.5c77 0 149.4-32.9 203.8-87.3 34.7-34.7 59.5-78.2 72.9-124-24 9-49.6 19.4-76.2 21.5-36.5 74-112.7 129.8-200.6 129.8zM752 127.9c-121.5 0-220 98.5-220 220s98.5 220 220 220 220-98.5 220-220-98.5-220-220-220zM792 463h-40V298.7c-20 14-36.2 24.5-60 31.3v-41.8c11.5-2.9 23.8-10.4 36.7-17.6 13-7.9 23.8-7.7 32.4-27.7H792V463z"/> </svg> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-random-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M112 405.2h218.2c7.1 0 21 5.8 26 10.8l38 38.6c13.6 13.8 35.7 13.9 49.5 0.4 13.8-13.6 13.9-35.7 0.4-49.5l-38-38.6c-18.1-18.4-50-31.7-75.8-31.7H112c-19.3 0-35 15.7-35 35 0 19.4 15.7 35 35 35z m623.2 0h62.4v42.6c0 10.9 7.5 15 16.7 8.8l125.8-83.9c9.3-6.2 9.2-16.2 0-22.4l-125.8-83.9c-9.3-6.2-16.7-2.2-16.7 8.8v60h-62.4c-53.5 0-123.5 29.3-161 67.4L393.9 585.7c-24.3 24.7-76.4 46.5-111.1 46.5H112c-19.3 0-35 15.7-35 35s15.7 35 35 35h170.7c53.5 0 123.5-29.3 161-67.4L624 451.7c24.4-24.7 76.4-46.5 111.2-46.5z m79.1 161.2c-9.3-6.2-16.7-2.2-16.7 8.8v57H681.9c-6.9 0-20.2-5.6-25-10.4l-37.3-37.9c-13.6-13.8-35.7-13.9-49.5-0.4-13.8 13.6-13.9 35.7-0.4 49.5l37.3 37.9c18 18.2 49.3 31.3 74.9 31.3h115.6v45.6c0 10.9 7.5 15 16.7 8.8L940 672.7c9.3-6.2 9.2-16.2 0-22.4l-125.7-83.9z"/> </svg> </a> <div class=cp-progress> <div class=cp-progress-fill></div> </div> </div> <div class="cp-drop-down-menu cp-drop-down-menu-info"> <div class=cp-audio-info> <span class=cp-audio-title></span> - <span class=cp-audio-artist></span> </div> <ul class=cp-playlist> </ul> </div> </c-player>';},function(e,t){e.exports='<svg class=cp-play-icon viewBox="0 0 1024 1024" version=1.1 xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink width=200 height=200> <path d="M64.279417 58.009844c0-21.327148 10.62092-39.540533 29.218194-50.118799a56.858178 56.858178 0 0 1 58.265769 0.255926l779.336659 453.969682c18.341348 10.706229 28.748996 28.748996 28.748996 49.905527 0 21.113877-10.407648 39.156645-28.748996 49.820219L151.76338 1015.854735a56.943486 56.943486 0 0 1-58.265769 0.255926 56.303672 56.303672 0 0 1-29.218194-50.161453V58.009844z"> </path> </svg>';},function(e,t,n){t=e.exports=n(16)(void 0),t.push([e.i,"@-webkit-keyframes miss-pointer-event {\n from {\n pointer-events: none; }\n to {\n pointer-events: auto; } }\n\n@keyframes miss-pointer-event {\n from {\n pointer-events: none; }\n to {\n pointer-events: auto; } }\n\nc-player {\n display: -webkit-inline-box;\n display: -ms-inline-flexbox;\n display: inline-flex;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -ms-flex-direction: column;\n flex-direction: column;\n position: relative;\n font-size: 12px;\n width: 300px; }\n c-player:hover .cp-progress {\n opacity: 1;\n -webkit-transform: scaleY(1) translateY(0%);\n transform: scaleY(1) translateY(0%); }\n c-player .cp-mainbody {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n min-height: 4.16667em;\n min-width: 25em;\n height: 4.16667em;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n background-color: #fff;\n position: relative;\n z-index: 1;\n -webkit-box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px;\n box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px; }\n c-player .cp-mainbody > * {\n margin-right: 0.58333em; }\n c-player .cp-mainbody:hover + .cp-drop-down-menu.cp-drop-down-menu-info {\n height: 2.08333em; }\n c-player .cp-drop-down-menu {\n margin: 0em 0.16667em 0;\n display: block;\n text-align: center;\n font-size: 1em;\n line-height: 2.08333em;\n background-color: rgba(255, 255, 255, 0.6);\n position: relative;\n z-index: 0;\n height: 0em;\n overflow: hidden;\n -webkit-box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px;\n box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px;\n -webkit-transition: height 0.25s ease 0.1s, -webkit-transform 0.25s ease 0.1s;\n transition: height 0.25s ease 0.1s, -webkit-transform 0.25s ease 0.1s;\n transition: transform 0.25s ease 0.1s, height 0.25s ease 0.1s;\n transition: transform 0.25s ease 0.1s, height 0.25s ease 0.1s, -webkit-transform 0.25s ease 0.1s; }\n c-player .cp-drop-down-menu span.cp-audio-title {\n max-width: 14.16667em;\n overflow: hidden;\n text-overflow: ellipsis; }\n c-player .cp-drop-down-menu span.cp-audio-artist {\n opacity: 0.6;\n max-width: 8.33333em;\n overflow: hidden;\n text-overflow: ellipsis; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-top {\n -webkit-box-ordinal-group: 0;\n -ms-flex-order: -1;\n order: -1; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-none {\n display: none; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-bottom {\n -webkit-box-ordinal-group: 2;\n -ms-flex-order: 1;\n order: 1; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-info .cp-playlist {\n display: none; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-info:hover {\n height: 2.08333em; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-playlist .cp-audio-info {\n display: none; }\n c-player .cp-drop-down-menu.cp-drop-down-menu-playlist {\n height: auto; }\n c-player .cp-playlist {\n margin: 0em;\n padding: 0em;\n list-style: none;\n text-align: left; }\n c-player .cp-playlist li:nth-of-type(even) {\n background: rgba(255, 255, 255, 0.2); }\n c-player .cp-playlist li {\n padding: 0em 0.83333em;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer; }\n c-player .cp-playlist li .cp-play-icon {\n display: inline-block;\n width: 1em;\n height: 1em;\n vertical-align: text-top;\n margin: 0px 0.41667em 0 0;\n fill: rgba(183, 28, 28, 0.8); }\n c-player .cp-playlist-artist {\n color: #000;\n opacity: 0.46; }\n c-player .cp-center-container {\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n position: relative;\n height: 100%; }\n c-player .cp-center-container .cp-controls {\n opacity: 0; }\n c-player .cp-center-container:hover .cp-controls {\n opacity: 1;\n -webkit-animation: miss-pointer-event 100ms;\n animation: miss-pointer-event 100ms; }\n c-player .cp-center-container:hover .cp-lyric {\n opacity: 0; }\n c-player .cp-controls {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n width: 100%;\n height: 100%;\n z-index: 1;\n -webkit-transition: opacity 0.25s ease;\n transition: opacity 0.25s ease; }\n c-player .cp-controls > * {\n margin-right: 1.25em; }\n c-player .cp-lyric {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -ms-flex-align: center;\n align-items: center;\n position: absolute;\n width: calc(100% - 1.66667em);\n height: calc(100% - 0.83333em);\n overflow: hidden;\n margin: 0.41667em 0.83333em;\n font-size: 1.16667em;\n -webkit-transition: opacity 0.25s ease;\n transition: opacity 0.25s ease; }\n c-player .cp-lyric-text {\n -webkit-box-flex: 1;\n -ms-flex-positive: 1;\n flex-grow: 1;\n white-space: nowrap;\n text-align: center;\n color: #424242; }\n c-player .cp-lyric-text .cp-lyric-text-sub {\n display: block;\n color: #757575;\n font-size: 0.85714em; }\n c-player .cp-lyric-text .cp-lyric-text-zoomout {\n font-size: 1em;\n -webkit-transform: translateY(0.08333em);\n transform: translateY(0.08333em);\n display: inline-block;\n margin: 0px 0.14286em; }\n c-player .cp-progress {\n -ms-flex-preferred-size: 100%;\n flex-basis: 100%;\n margin: 0em;\n opacity: 0.8;\n overflow: hidden;\n -webkit-transform: scaleY(0) translateY(-100%);\n transform: scaleY(0) translateY(-100%);\n background: #fff;\n -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;\n transition: opacity 0.3s ease, -webkit-transform 0.3s ease;\n transition: opacity 0.3s ease, transform 0.3s ease;\n transition: opacity 0.3s ease, transform 0.3s ease, -webkit-transform 0.3s ease; }\n c-player .cp-progress .cp-progress-fill {\n display: block;\n height: 0.16667em;\n -webkit-transform: translateX(-100%);\n transform: translateX(-100%);\n background: #F44336; }\n c-player .cp-poster {\n width: 4.16667em;\n height: 4.16667em;\n background-repeat: repeat;\n background-position: 50% 50%;\n background-size: cover;\n background-origin: padding-box;\n background-attachment: scroll;\n border-right: 0.08333em solid #eee;\n background-image: url(\"http://p1.music.126.net/xXXsTafARePvyQUDb6q9HQ==/3386495814644488.jpg?param=200y200\"); }\n c-player .cp-play-icon {\n width: 1.04167em;\n height: 1.04167em;\n display: block;\n overflow: hidden;\n position: relative; }\n c-player .cp-play-icon .cp-play-icon-left {\n height: 100%;\n float: left;\n background-color: #F44336;\n width: 36%;\n -webkit-transition: width 0.25s ease;\n transition: width 0.25s ease;\n overflow: hidden; }\n c-player .cp-play-icon .cp-play-icon-right {\n height: 100%;\n float: right;\n background-color: #F44336;\n width: 36%;\n -webkit-transition: width 0.25s ease;\n transition: width 0.25s ease;\n overflow: hidden; }\n c-player .cp-play-icon .cp-play-icon-triangle-1 {\n -webkit-transform: translate(0, -100%);\n transform: translate(0, -100%); }\n c-player .cp-play-icon .cp-play-icon-triangle-2 {\n -webkit-transform: translate(0, 100%);\n transform: translate(0, 100%); }\n c-player .cp-play-icon .cp-play-icon-triangle-1,\n c-player .cp-play-icon .cp-play-icon-triangle-2 {\n position: absolute;\n top: 0;\n right: 0;\n background-color: transparent;\n width: 0;\n height: 0;\n border-right: 1.04167em solid #fff;\n border-top: 0.52083em solid transparent;\n border-bottom: 0.52083em solid transparent;\n -webkit-transition: -webkit-transform 0.25s ease;\n transition: -webkit-transform 0.25s ease;\n transition: transform 0.25s ease;\n transition: transform 0.25s ease, -webkit-transform 0.25s ease; }\n c-player .cp-play-icon.cp-play-icon-paused .cp-play-icon-left {\n width: 50%; }\n c-player .cp-play-icon.cp-play-icon-paused .cp-play-icon-right {\n width: 50%; }\n c-player .cp-play-icon.cp-play-icon-paused .cp-play-icon-triangle-1 {\n -webkit-transform: translate(0, -50%);\n transform: translate(0, -50%); }\n c-player .cp-play-icon.cp-play-icon-paused .cp-play-icon-triangle-2 {\n -webkit-transform: translate(0, 50%);\n transform: translate(0, 50%); }\n c-player .cp-play-icon.cp-play-icon-hover .cp-play-icon-left, c-play