diff --git a/README.md b/README.md
index 458426e..7e04a5b 100644
--- a/README.md
+++ b/README.md
@@ -43,7 +43,6 @@ $ npm install aplayer --save
```JS
var ap = new APlayer(option);
-ap.init();
```
#### Options
@@ -70,7 +69,6 @@ var option = {
#### API
-+ `ap.init()` // Load player
+ `ap.play()` // Resume play
+ `ap.play(time)` // Set currentTime
+ `ap.pause()` // Pause
diff --git a/demo/demo.js b/demo/demo.js
index d93f34f..5cd0e6c 100644
--- a/demo/demo.js
+++ b/demo/demo.js
@@ -34,7 +34,6 @@ ap1.on('ended', function () {
ap1.on('error', function () {
console.log('error');
});
-ap1.init();
var ap2 = new APlayer({
element: document.getElementById('player2'),
@@ -50,7 +49,6 @@ var ap2 = new APlayer({
pic: 'http://devtest.qiniudn.com/Preparation.jpg'
}
});
-ap2.init();
var ap3 = new APlayer({
element: document.getElementById('player3'),
@@ -67,7 +65,6 @@ var ap3 = new APlayer({
lrc: "[by:京兆万年]\n[ti:回レ!雪月花 小紫ver.]\n[ar:小倉唯]\n[lr:ヒゲドライバー]\n[co:ヒゲドライバー]\n[ag:ヒゲドライバー]\n[00:00.00]せ〜の いちにっさんはい!(预~备 一 二 三 嗨!)\n[00:04.68]ほい! いよーーーーっ ぽん!(嘿 咿哟 嘭)\n[00:07.66]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[00:11.12]ハッハッハッハッハッハッ う~(哈 哈 哈 哈 哈 哈 呜~)\n[00:13.36]さぁさぁさぁ(来 来 来)\n[00:14.08]これよりご覧いただきますは(接下来诸位将欣赏到的是)\n[00:15.65]カブキ者たちの栄枯盛衰(歌舞伎演员们的荣辱盛衰)\n[00:17.14]時代常に日進月歩(时代总是在日新月异)\n[00:18.24]聞いてってよ老若男女(且听我一一道来 男女老少)\n[00:20.14]一見は勧善懲悪(乍一看是惩恶扬善)\n[00:21.49]悪者どもを一刀両断(将坏人们一刀两断)\n[00:22.85]「でもホンドにそれだけで楽しいの?」(“但是你真的会因此而觉得扬眉吐气吗?”)\n[00:25.63]もうなんだって蒟蒻問答(无论问什么 都是牛头马嘴)\n[00:27.58]ハッハッハッハッハッハッハィヤ(哈哈哈哈哈哈 咿呀)\n[00:30.57]ハッハッハッハッ(哈哈哈哈)\n[00:31.97]いよーーーーっ ぽん!(咿哟 嘭)\n[00:33.61]どこからともなく現れて(自何处出现委实难料)\n[00:34.96]すぐどこかへ行っちゃって神出鬼沒(眼又遁隐他处总是神出鬼没)\n[00:36.35]チャンスを待ったら一日千秋(若是静候机会 便是一日千秋)\n[00:38.03]追いかければ東奔西走(追上前去的话又要东奔西走)\n[00:39.68]時代常に千変万化(时代总是千变万化)\n[00:40.95]人の心は複雑怪奇(世人之心复杂怪奇)\n[00:42.31]「でも本気でそんなこ言ってんの?」(“但是说着这些话的你岂不也是难免戏谑?”)\n[00:45.02]もうどうにも満身創痍(也罢 无论怎样都将满身疮痍)\n[00:46.98]嗚呼、巡り巡って夜の町(呜呼 绕来绕去相会在这夜色下的街)\n[00:53.27]キミは合図出し踊りだす((由)你发出信号 (让)我们一同起舞转)\n[00:58.12]はぁ~(哈呜~)\n[00:58.88]回レ回レ回レ回レ回レ回レ回レ回レ回レ!(旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧!)\n[01:02.12]華麗に花弁 散らすように(在散落的美丽花瓣中)\n[01:04.97]回レ回レ回レ回レ回レ回レ回レ回レ回レ!(旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧!)\n[01:08.13]髪も振り乱して(头发凌乱又怎样?)\n[01:10.23]一昨日、昨日、今日と、明日と、明後日と(前日、昨日、今日、明日、后日)\n[01:14.13]この宴は続く(这场宴会亦不息)\n[01:16.31]踊レ、歌エ、一心不乱に回レ!(舞动吧 歌唱吧 一心不乱的旋转吧于)\n[01:20.19]今宵は雪月花(今夜的雪月花)\n[01:25.43]ほい! いよーーーーっ ぽん!(哈~!~哟ーーーー~嘣~!)\n[01:29.14]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[01:32.16]ハッハッハッハッハッハッ う~(哈 哈 哈 哈 哈 哈 呜)\n[01:34.39]ねぇねぇねぇ(呐~呐~呐~)\n[01:35.12]この世に平安訪れるの?(平安已经访问此世了吗?)\n[01:36.50]のべつ幕無し丁丁発止(不会闭幕的丁当争斗)\n[01:38.09]兵ども千客万来(官兵们接踵而来)\n[01:39.50]ひしめき合群雄割拠(相互吵吵嚷嚷群雄割据)\n[01:41.00]伸るか反るか一攫千金(成败在于敢否一举千金)\n[01:42.47]気が付いたら絶体絶命(回过头来却已穷途末路)\n[01:43.50]「でも本音のとこ、どうなってんの?」(「不过真心的所在、到底是什么样呢?」)\n[01:46.62]もうまったく奇想天外(真是的总这么异想天开)\n[01:48.51]嗚呼、辿り辿って夜の町(呜呼、追溯于夜晚小镇上)\n[01:54.83]迷い一つなく踊りだす(心无杂念的就此起舞吧)\n[01:59.68]はぁ~(哈阿~)\n[02:00.44]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[02:03.64]華麗に花弁 散らすように(犹如花瓣华丽的散落一般)\n[02:06.49]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[02:09.66]髪も振り乱して(长发也随风飘散)\n[02:11.72]一昨日、昨日、今日と、明日と、明後日と(无论前天、昨天、还是今天、明天、与后天)\n[02:15.63]この宴は続く(这宴会还会持续)\n[02:17.67]踊レ、歌エ、一心不乱に回レ!(跳吧、唱吧、一心一意的转吧!)\n[02:21.60]今宵は雪月花(因为今宵乃是雪月花)\n[02:36.74]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[02:39.72]ハッハッハッハッハッハッ さぁさぁさぁ(哈 哈 哈 哈 哈 哈 来~来~来~)\n[02:42.45]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[02:45.49]ハッハッハッハッハッハッ(哈 哈 哈 哈 哈 哈)\n[02:47.66]花で一つ、鳥で二つ(花就是一、鸟就是二)\n[02:51.31]手打ち鳴らす(拍着手轻声唱)\n[02:54.12]風で三つ、嗚呼、月出て四つ(风就是三、呜呼、月出就有四)\n[02:58.76]鳴らす鳴らす……(轻声唱轻轻唱……)\n[03:00.09]花で一つ、鳥で二つ(花就是一、鸟就是二)\n[03:03.34]手打ち鳴らす(拍着手轻声唱)\n[03:06.25]風で三つ、嗚呼、月出て四つ(风就是三、呜呼、月出就有四)\n[03:10.78]鳴らす鳴らす……(轻轻唱轻声唱……)\n[03:13.28]今は(在此)\n[03:15.35]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[03:18.63]華麗に花弁 散らすように(犹如花瓣华丽的散落一般)\n[03:21.35]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[03:24.60]髪も振り乱して(长发也随风飘散)\n[03:26.72]一昨日、昨日、今日と、明日と、明後日と(无论前天、昨天、还是今天、明天、与后天)\n[03:30.67]この宴は続く(这宴会不会结束)\n[03:32.75]踊レ、歌エ、一心不乱に回レ!(跳吧、唱吧、一心一意的转吧!)\n[03:36.63]今宵は何曜日か?(今宵是星期几呢?)\n[03:39.02]水木金?(三四五?)\n[03:40.56]土日月火?(六七一二?)\n[03:44.11]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[03:47.00]ハッハッハッハッ(哈 哈 哈 哈 哈 哈)\n[03:48.57]いよーーーーっ ぽん!(~哟ーーーー~嘣~!)\n[03:50.43]-終わり-(-End-)"
}
});
-ap3.init();
var ap4 = new APlayer({
element: document.getElementById('player4'),
@@ -97,7 +94,6 @@ var ap4 = new APlayer({
}
]
});
-ap4.init();
var ap5 = new APlayer({
element: document.getElementById('player5'),
@@ -129,5 +125,4 @@ var ap5 = new APlayer({
lrc: "[by:京兆万年]\n[ti:回レ!雪月花 小紫ver.]\n[ar:小倉唯]\n[lr:ヒゲドライバー]\n[co:ヒゲドライバー]\n[ag:ヒゲドライバー]\n[00:00.00]せ〜の いちにっさんはい!(预~备 一 二 三 嗨!)\n[00:04.68]ほい! いよーーーーっ ぽん!(嘿 咿哟 嘭)\n[00:07.66]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[00:11.12]ハッハッハッハッハッハッ う~(哈 哈 哈 哈 哈 哈 呜~)\n[00:13.36]さぁさぁさぁ(来 来 来)\n[00:14.08]これよりご覧いただきますは(接下来诸位将欣赏到的是)\n[00:15.65]カブキ者たちの栄枯盛衰(歌舞伎演员们的荣辱盛衰)\n[00:17.14]時代常に日進月歩(时代总是在日新月异)\n[00:18.24]聞いてってよ老若男女(且听我一一道来 男女老少)\n[00:20.14]一見は勧善懲悪(乍一看是惩恶扬善)\n[00:21.49]悪者どもを一刀両断(将坏人们一刀两断)\n[00:22.85]「でもホンドにそれだけで楽しいの?」(“但是你真的会因此而觉得扬眉吐气吗?”)\n[00:25.63]もうなんだって蒟蒻問答(无论问什么 都是牛头马嘴)\n[00:27.58]ハッハッハッハッハッハッハィヤ(哈哈哈哈哈哈 咿呀)\n[00:30.57]ハッハッハッハッ(哈哈哈哈)\n[00:31.97]いよーーーーっ ぽん!(咿哟 嘭)\n[00:33.61]どこからともなく現れて(自何处出现委实难料)\n[00:34.96]すぐどこかへ行っちゃって神出鬼沒(眼又遁隐他处总是神出鬼没)\n[00:36.35]チャンスを待ったら一日千秋(若是静候机会 便是一日千秋)\n[00:38.03]追いかければ東奔西走(追上前去的话又要东奔西走)\n[00:39.68]時代常に千変万化(时代总是千变万化)\n[00:40.95]人の心は複雑怪奇(世人之心复杂怪奇)\n[00:42.31]「でも本気でそんなこ言ってんの?」(“但是说着这些话的你岂不也是难免戏谑?”)\n[00:45.02]もうどうにも満身創痍(也罢 无论怎样都将满身疮痍)\n[00:46.98]嗚呼、巡り巡って夜の町(呜呼 绕来绕去相会在这夜色下的街)\n[00:53.27]キミは合図出し踊りだす((由)你发出信号 (让)我们一同起舞转)\n[00:58.12]はぁ~(哈呜~)\n[00:58.88]回レ回レ回レ回レ回レ回レ回レ回レ回レ!(旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧!)\n[01:02.12]華麗に花弁 散らすように(在散落的美丽花瓣中)\n[01:04.97]回レ回レ回レ回レ回レ回レ回レ回レ回レ!(旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧旋转吧!)\n[01:08.13]髪も振り乱して(头发凌乱又怎样?)\n[01:10.23]一昨日、昨日、今日と、明日と、明後日と(前日、昨日、今日、明日、后日)\n[01:14.13]この宴は続く(这场宴会亦不息)\n[01:16.31]踊レ、歌エ、一心不乱に回レ!(舞动吧 歌唱吧 一心不乱的旋转吧于)\n[01:20.19]今宵は雪月花(今夜的雪月花)\n[01:25.43]ほい! いよーーーーっ ぽん!(哈~!~哟ーーーー~嘣~!)\n[01:29.14]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[01:32.16]ハッハッハッハッハッハッ う~(哈 哈 哈 哈 哈 哈 呜)\n[01:34.39]ねぇねぇねぇ(呐~呐~呐~)\n[01:35.12]この世に平安訪れるの?(平安已经访问此世了吗?)\n[01:36.50]のべつ幕無し丁丁発止(不会闭幕的丁当争斗)\n[01:38.09]兵ども千客万来(官兵们接踵而来)\n[01:39.50]ひしめき合群雄割拠(相互吵吵嚷嚷群雄割据)\n[01:41.00]伸るか反るか一攫千金(成败在于敢否一举千金)\n[01:42.47]気が付いたら絶体絶命(回过头来却已穷途末路)\n[01:43.50]「でも本音のとこ、どうなってんの?」(「不过真心的所在、到底是什么样呢?」)\n[01:46.62]もうまったく奇想天外(真是的总这么异想天开)\n[01:48.51]嗚呼、辿り辿って夜の町(呜呼、追溯于夜晚小镇上)\n[01:54.83]迷い一つなく踊りだす(心无杂念的就此起舞吧)\n[01:59.68]はぁ~(哈阿~)\n[02:00.44]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[02:03.64]華麗に花弁 散らすように(犹如花瓣华丽的散落一般)\n[02:06.49]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[02:09.66]髪も振り乱して(长发也随风飘散)\n[02:11.72]一昨日、昨日、今日と、明日と、明後日と(无论前天、昨天、还是今天、明天、与后天)\n[02:15.63]この宴は続く(这宴会还会持续)\n[02:17.67]踊レ、歌エ、一心不乱に回レ!(跳吧、唱吧、一心一意的转吧!)\n[02:21.60]今宵は雪月花(因为今宵乃是雪月花)\n[02:36.74]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[02:39.72]ハッハッハッハッハッハッ さぁさぁさぁ(哈 哈 哈 哈 哈 哈 来~来~来~)\n[02:42.45]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[02:45.49]ハッハッハッハッハッハッ(哈 哈 哈 哈 哈 哈)\n[02:47.66]花で一つ、鳥で二つ(花就是一、鸟就是二)\n[02:51.31]手打ち鳴らす(拍着手轻声唱)\n[02:54.12]風で三つ、嗚呼、月出て四つ(风就是三、呜呼、月出就有四)\n[02:58.76]鳴らす鳴らす……(轻声唱轻轻唱……)\n[03:00.09]花で一つ、鳥で二つ(花就是一、鸟就是二)\n[03:03.34]手打ち鳴らす(拍着手轻声唱)\n[03:06.25]風で三つ、嗚呼、月出て四つ(风就是三、呜呼、月出就有四)\n[03:10.78]鳴らす鳴らす……(轻轻唱轻声唱……)\n[03:13.28]今は(在此)\n[03:15.35]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[03:18.63]華麗に花弁 散らすように(犹如花瓣华丽的散落一般)\n[03:21.35]回レ回レ回レ回レ回レ 回レ回レ回レ回レ!(转啊转啊转啊转啊转啊转啊转啊转啊转啊!)\n[03:24.60]髪も振り乱して(长发也随风飘散)\n[03:26.72]一昨日、昨日、今日と、明日と、明後日と(无论前天、昨天、还是今天、明天、与后天)\n[03:30.67]この宴は続く(这宴会不会结束)\n[03:32.75]踊レ、歌エ、一心不乱に回レ!(跳吧、唱吧、一心一意的转吧!)\n[03:36.63]今宵は何曜日か?(今宵是星期几呢?)\n[03:39.02]水木金?(三四五?)\n[03:40.56]土日月火?(六七一二?)\n[03:44.11]ハッハッハッハッハッハッハィヤ(哈 哈 哈 哈 哈 哈 嗨呀)\n[03:47.00]ハッハッハッハッ(哈 哈 哈 哈 哈 哈)\n[03:48.57]いよーーーーっ ぽん!(~哟ーーーー~嘣~!)\n[03:50.43]-終わり-(-End-)"
}
]
-});
-ap5.init();
\ No newline at end of file
+});
\ No newline at end of file
diff --git a/dist/APlayer.min.js b/dist/APlayer.min.js
index d4d1b48..edb2fc3 100644
--- a/dist/APlayer.min.js
+++ b/dist/APlayer.min.js
@@ -1,3 +1,3 @@
-!function(e,a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var t=a();for(var l in t)("object"==typeof exports?exports:e)[l]=t[l]}}(this,function(){return function(e){function a(l){if(t[l])return t[l].exports;var i=t[l]={exports:{},id:l,loaded:!1};return e[l].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}var t={};return a.m=e,a.c=t,a.p="",a(0)}([function(e,a,t){"use strict";function l(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(a,"__esModule",{value:!0});var i=function(){function e(e,a){for(var t=0;t\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(a.autoplay=!1);var i={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",loop:!0};for(var r in i)i.hasOwnProperty(r)&&!a.hasOwnProperty(r)&&(a[r]=i[r]);this.playIndex="[object Array]"===Object.prototype.toString.call(a.music)?0:-1,this.option=a,this.audios=[],this.loop=a.loop,this.secondToTime=function(e){var a=function(e){return e<10?"0"+e:""+e},t=parseInt(e/60),l=parseInt(e-60*t);return a(t)+":"+a(l)},this.parseLrc=function(e){for(var a=[],t=0;t0?a:0,a=a<1?a:1,t[e+"Bar"].style[l]=100*a+"%"},this.updateLrc=function(){var e=arguments.length<=0||void 0===arguments[0]?t.audio.currentTime:arguments[0];if(t.lrcIndex>t.lrc.length-1||e=t.lrc[t.lrcIndex+1][0])for(var a=0;a=t.lrc[a][0]&&(!t.lrc[a+1]||e-1,this.music=this.multiple?this.option.music[this.playIndex]:this.option.music;var l=void 0;if(this.option.showlrc){var i=[];if(1===this.option.showlrc)if(this.multiple)for(l=0;l\n \n \n
\n \n \n
\n \n \n
\n
\n
\n
\n
\n
\n - 00:00 / 00:00\n \n
\n
\n
\n
\n
\n "+(this.multiple?'":"")+"\n
\n
\n
");if(this.multiple){for(n+='\n \n
',l=0;l\n \n '+(l+1)+'\n '+this.option.music[l].title+'\n '+this.option.music[l].author+"\n ";n+="\n
\n
"}this.element.innerHTML=n,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-loop")[0].style.display="none"),this.ptime=this.element.getElementsByClassName("aplayer-ptime")[0],this.element.getElementsByClassName("aplayer-info")[0].offsetWidth<200&&this.element.getElementsByClassName("aplayer-time")[0].classList.add("aplayer-time-narrow"),this.bar=this.element.getElementsByClassName("aplayer-bar-wrap")[0],this.bar.style.marginRight=this.element.getElementsByClassName("aplayer-time")[0].offsetWidth+5+"px",this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){t.button.classList.contains("aplayer-play")?t.play():t.button.classList.contains("aplayer-pause")&&t.pause()}),this.multiple&&!function(){for(var e=t.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li"),a=function(a){e[a].addEventListener("click",function(){var l=parseInt(e[a].getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;l!==t.playIndex?(t.setMusic(l),t.isMobile?t.pause():t.play()):t.toggle()})},l=0;l0?i:0,i=i<1?i:1,t.updateBar("played",i,"width"),t.option.showlrc&&t.updateLrc(parseFloat(t.playedBar.style.width)/100*t.audio.duration),t.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=t.secondToTime(i*t.audio.duration)},p=function y(){document.removeEventListener("mouseup",y),document.removeEventListener("mousemove",s),t.audio.currentTime=parseFloat(t.playedBar.style.width)/100*t.audio.duration,t.playedTime=setInterval(function(){t.updateBar("played",t.audio.currentTime/t.audio.duration,"width"),t.option.showlrc&&t.updateLrc(),t.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=t.secondToTime(t.audio.currentTime),t.trigger("playing")},100)};this.thumb.addEventListener("mousedown",function(){o=t.bar.clientWidth,clearInterval(t.playedTime),document.addEventListener("mousemove",s),document.addEventListener("mouseup",p)}),this.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var u=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];var c=35;this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var l=e||window.event,i=(c-l.clientY+a(u))/c;i=i>0?i:0,i=i<1?i:1,t.volume(i)}),this.volumeicon.addEventListener("click",function(){t.audio.muted?(t.audio.muted=!1,t.volumeicon.className=1===t.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===t.audio.volume?(t.volumeicon.className="aplayer-icon aplayer-icon-volume-up",t.volumeicon.innerHTML=t.getSVG("volume-up")):(t.volumeicon.className="aplayer-icon aplayer-icon-volume-down",t.volumeicon.innerHTML=t.getSVG("volume-down")),t.updateBar("volume",t.audio.volume,"height")):(t.audio.muted=!0,t.volumeicon.className="aplayer-icon aplayer-icon-volume-off",t.volumeicon.innerHTML=t.getSVG("volume-off"),t.updateBar("volume",0,"height"))});var d=this.element.getElementsByClassName("aplayer-icon-loop")[0];d.addEventListener("click",function(){t.loop?(d.classList.add("aplayer-noloop"),t.loop=!1,t.audio.loop=!t.multiple&&t.loop):(d.classList.remove("aplayer-noloop"),t.loop=!0,t.audio.loop=!t.multiple&&t.loop)}),this.multiple&&!function(){var e=t.element.getElementsByClassName("aplayer-list")[0];e.style.height=e.offsetHeight+"px",t.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){e.classList.contains("aplayer-list-hide")?e.classList.remove("aplayer-list-hide"):e.classList.add("aplayer-list-hide")})}(),this.setMusic(0),r.push(this)}},{key:"setMusic",value:function(e){var a=this;this.multiple&&"undefined"!=typeof e&&(this.playIndex=e);var t=this.playIndex;if(this.music=this.multiple?this.option.music[t]:this.option.music,this.music.pic&&(this.element.getElementsByClassName("aplayer-pic")[0].style.backgroundImage="url('"+this.music.pic+"')"),this.element.getElementsByClassName("aplayer-title")[0].innerHTML=this.music.title,this.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - "+this.music.author,this.multiple&&(this.element.getElementsByClassName("aplayer-list-light")[0]&&this.element.getElementsByClassName("aplayer-list-light")[0].classList.remove("aplayer-list-light"),this.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li")[t].classList.add("aplayer-list-light")),this.audio&&(this.pause(),this.audio.currentTime=0),this.multiple&&!this.audios[t]||this.playIndex===-1?(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.option.preload?this.audio.preload=this.option.preload:this.audio.preload=this.isMobile?"none":"metadata",this.audio.addEventListener("durationchange",function(){1!==a.audio.duration&&(a.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=a.secondToTime(a.audio.duration))}),this.audio.addEventListener("progress",function(){var e=a.audio.buffered.length?a.audio.buffered.end(a.audio.buffered.length-1)/a.audio.duration:0;a.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){a.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",a.trigger("pause")}),this.audio.addEventListener("canplay",function(){a.trigger("canplay")}),this.ended=!1,this.multiple?this.audio.addEventListener("ended",function(){return a.isMobile?(a.ended=!0,void a.pause()):void(0!==a.audio.currentTime&&(a.playIndex"+this.lrc[i][1]+"
";this.lrcContents.innerHTML=l,this.lrcIndex||(this.lrcIndex=0),this.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),this.lrcContents.style.transform="translateY(0px)",this.lrcContents.style.webkitTransform="translateY(0px)"}1!==this.audio.duration&&(this.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=this.audio.duration?this.secondToTime(this.audio.duration):"00:00"),this.option.autoplay&&!this.isMobile&&this.play(),this.option.autoplay=!0,this.isMobile&&this.pause()}},{key:"play",value:function(e){var a=this;if("[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused){if(this.button.classList.remove("aplayer-play"),this.button.classList.add("aplayer-pause"),this.button.innerHTML="",setTimeout(function(){a.button.innerHTML='\n "},100),this.option.mutex)for(var t=0;t'+e.getSVG("play")+" "},100),this.audio.pause(),clearInterval(this.playedTime),this.trigger("pause"))}},{key:"volume",value:function(e){this.updateBar("volume",e,"height"),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),1===e?(this.volumeicon.className="aplayer-icon aplayer-icon-volume-up",this.volumeicon.innerHTML=this.getSVG("volume-up")):(this.volumeicon.className="aplayer-icon aplayer-icon-volume-down",this.volumeicon.innerHTML=this.getSVG("volume-down"))}},{key:"on",value:function(e,a){"function"==typeof a&&this.event[e].push(a)}},{key:"toggle",value:function(){this.audio.paused?this.play():this.pause()}}]),e}();a.APlayer=n},function(e,a,t){var l=t(2);"string"==typeof l&&(l=[[e.id,l,""]]);t(5)(l,{});l.locals&&(e.exports=l.locals)},function(e,a,t){a=e.exports=t(3)(),a.push([e.id,".aplayer-narrow{width:66px}.aplayer-narrow .aplayer-info{display:none}.aplayer-withlrc.aplayer-narrow{width:106px}.aplayer-withlrc.aplayer .aplayer-pic{height:106px;width:106px}.aplayer-withlrc.aplayer .aplayer-info{margin-left:106px;height:106px}.aplayer-withlrc.aplayer .aplayer-lrc{display:block}.aplayer{font-family:Arial,Helvetica,sans-serif;margin:5px;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);border-radius:2px;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal}.aplayer *{box-sizing:content-box}.aplayer .aplayer-icon{width:15px;height:15px;border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;vertical-align:middle;padding:0}.aplayer .aplayer-icon .aplayer-fill{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.aplayer .aplayer-lrc-content{display:none}.aplayer .aplayer-pic{position:relative;float:left;height:66px;width:66px;background-image:url("+t(4)+");background-size:100%;-webkit-transition:all .3s ease;transition:all .3s ease}.aplayer .aplayer-pic .aplayer-button{position:absolute;border-radius:50%;opacity:.8;cursor:pointer;text-shadow:0 1px 1px rgba(0,0,0,.2);box-shadow:0 1px 1px rgba(0,0,0,.2);background:rgba(0,0,0,.2);-webkit-transition:all .1s ease;transition:all .1s ease}.aplayer .aplayer-pic .aplayer-button:hover{opacity:1}.aplayer .aplayer-pic .aplayer-button .aplayer-fill{fill:#fff}.aplayer .aplayer-pic .aplayer-hide{display:none}.aplayer .aplayer-pic .aplayer-play{width:26px;height:26px;border:2px solid #fff;bottom:50%;right:50%;margin:0 -15px -15px 0}.aplayer .aplayer-pic .aplayer-play .aplayer-icon-play{position:absolute;top:3px;left:4px;height:20px;width:20px}.aplayer .aplayer-pic .aplayer-pause{width:16px;height:16px;border:2px solid #fff;bottom:4px;right:4px}.aplayer .aplayer-pic .aplayer-pause .aplayer-icon-pause{position:absolute;top:2px;left:2px;height:12px;width:12px}.aplayer .aplayer-info{margin-left:66px;padding:14px 7px 0 10px;height:66px;box-sizing:border-box}.aplayer .aplayer-info .aplayer-music{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-bottom:13px}.aplayer .aplayer-info .aplayer-music .aplayer-title{font-size:14px}.aplayer .aplayer-info .aplayer-music .aplayer-author{font-size:12px;color:#666}.aplayer .aplayer-info .aplayer-controller{position:relative}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap{margin:0 140px 0 5px;padding:4px 0;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar{position:relative;height:2px;width:100%;background:#cdcdcd}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded{position:absolute;left:0;top:0;bottom:0;background:#aaa;height:2px;-webkit-transition:all .5s ease;transition:all .5s ease}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played{position:absolute;left:0;top:0;bottom:0;height:2px}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:8px;width:8px;border-radius:50%;background:#fff;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-time{position:absolute;right:0;bottom:-3px;height:17px;color:#999;font-size:11px}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner{vertical-align:middle}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon{cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill{fill:#666}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-loop{margin-right:4px}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-noloop .aplayer-fill{fill:#ddd}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-noloop:hover .aplayer-fill{fill:#bbb}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill{fill:#000}.aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-loop,.aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu{display:none}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap{position:relative;display:inline-block;margin-left:3px;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-volume-bar-wrap{display:block}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap{display:none;position:absolute;bottom:15px;right:-3px;width:25px;height:40px;z-index:99}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar{position:absolute;bottom:0;right:10px;width:5px;height:35px;background:#aaa}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume{position:absolute;bottom:0;right:0;width:5px;-webkit-transition:all .1s ease;transition:all .1s ease}.aplayer .aplayer-lrc{display:none;position:relative;height:40px;background:#fff;text-align:center;overflow:hidden;margin:-10px 0 10px}.aplayer .aplayer-lrc:before{top:0;height:10%;background:-webkit-linear-gradient(top,#fff,hsla(0,0%,100%,0));background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(180deg,#fff 0,hsla(0,0%,100%,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#00ffffff',GradientType=0)}.aplayer .aplayer-lrc:after,.aplayer .aplayer-lrc:before{position:absolute;z-index:1;display:block;overflow:hidden;width:100%;content:' '}.aplayer .aplayer-lrc:after{bottom:0;height:33%;background:-webkit-linear-gradient(bottom,#fff,hsla(0,0%,100%,0));background:-webkit-gradient(linear,left bottom,left top,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(0deg,#fff 0,hsla(0,0%,100%,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff',endColorstr='#ffffff',GradientType=0)}.aplayer .aplayer-lrc p{font-size:12px;color:#666;line-height:20px!important;height:20px!important;padding:0!important;margin:0!important;-webkit-transition:all .5s ease-out;transition:all .5s ease-out;opacity:.4;overflow:hidden}.aplayer .aplayer-lrc p.aplayer-lrc-current{opacity:1}.aplayer .aplayer-lrc .aplayer-lrc-contents{width:100%;-webkit-transition:all .5s ease-out;transition:all .5s ease-out}.aplayer .aplayer-list{overflow:auto;-webkit-transition:all .5s ease;transition:all .5s ease}.aplayer .aplayer-list.aplayer-list-hide{height:0!important}.aplayer .aplayer-list ol{list-style-type:none;margin:0;padding:0}.aplayer .aplayer-list ol li{position:relative;height:32px;line-height:32px;padding:0 15px;font-size:12px;border-top:1px solid #e9e9e9;cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease;overflow:hidden}.aplayer .aplayer-list ol li:hover{background:#efefef}.aplayer .aplayer-list ol li.aplayer-list-light{background:#e9e9e9}.aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-cur{display:inline-block}.aplayer .aplayer-list ol li .aplayer-list-cur{display:none;width:3px;height:22px;position:absolute;left:0;top:5px;cursor:pointer}.aplayer .aplayer-list ol li .aplayer-list-index{color:#666;margin-right:12px;cursor:pointer}.aplayer .aplayer-list ol li .aplayer-list-author{color:#666;float:right;cursor:pointer}@-webkit-keyframes aplayer-roll{0%{left:0}to{left:-100%}}@keyframes aplayer-roll{0%{left:0}to{left:-100%}}",""])},function(e,a){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],a=0;a\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(a.autoplay=!1);var s={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",loop:!0};for(var p in s)s.hasOwnProperty(p)&&!a.hasOwnProperty(p)&&(a[p]=s[p]);this.playIndex="[object Array]"===Object.prototype.toString.call(a.music)?0:-1,this.option=a,this.audios=[],this.loop=a.loop,this.secondToTime=function(e){var a=function(e){return e<10?"0"+e:""+e},t=parseInt(e/60),l=parseInt(e-60*t);return a(t)+":"+a(l)};var u=function(e){for(var a=[],t=0;t0?a:0,a=a<1?a:1,f[e+"Bar"].style[t]=100*a+"%"},this.updateLrc=function(){var e=arguments.length<=0||void 0===arguments[0]?n.audio.currentTime:arguments[0];if(n.lrcIndex>n.lrc.length-1||e=n.lrc[n.lrcIndex+1][0])for(var a=0;a=n.lrc[a][0]&&(!n.lrc[a+1]||e-1,this.music=this.multiple?this.option.music[this.playIndex]:this.option.music;var y=void 0;if(this.option.showlrc){var h=[];if(1===this.option.showlrc)if(this.multiple)for(y=0;y\n \n \n
\n \n \n
\n \n \n
\n
\n
\n
\n
\n
\n - 00:00 / 00:00\n \n
\n
\n
\n
\n
\n "+(this.multiple?'":"")+"\n
\n
\n
");if(this.multiple){for(m+='\n \n
',y=0;y\n \n '+(y+1)+'\n '+this.option.music[y].title+'\n '+this.option.music[y].author+"\n ";m+="\n
\n
"}this.element.innerHTML=m,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-loop")[0].style.display="none"),this.ptime=this.element.getElementsByClassName("aplayer-ptime")[0],this.element.getElementsByClassName("aplayer-info")[0].offsetWidth<200&&this.element.getElementsByClassName("aplayer-time")[0].classList.add("aplayer-time-narrow");var f={};f.barWrap=this.element.getElementsByClassName("aplayer-bar-wrap")[0],f.barWrap.style.marginRight=this.element.getElementsByClassName("aplayer-time")[0].offsetWidth+5+"px",this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){n.button.classList.contains("aplayer-play")?n.play():n.button.classList.contains("aplayer-pause")&&n.pause()}),this.multiple&&!function(){for(var e=n.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li"),a=function(a){e[a].addEventListener("click",function(){var t=parseInt(e[a].getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;t!==n.playIndex?(n.setMusic(t),n.isMobile?n.pause():n.play()):n.toggle()})},t=0;t0?l:0,l=l<1?l:1,n.updateBar("played",l,"width"),n.option.showlrc&&n.updateLrc(parseFloat(f.playedBar.style.width)/100*n.audio.duration),n.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=n.secondToTime(l*n.audio.duration)},x=function B(){document.removeEventListener("mouseup",B),document.removeEventListener("mousemove",b),n.audio.currentTime=parseFloat(f.playedBar.style.width)/100*n.audio.duration,n.playedTime=setInterval(function(){n.updateBar("played",n.audio.currentTime/n.audio.duration,"width"),n.option.showlrc&&n.updateLrc(),n.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=n.secondToTime(n.audio.currentTime),n.trigger("playing")},100)};v.addEventListener("mousedown",function(){g=f.barWrap.clientWidth,clearInterval(n.playedTime),document.addEventListener("mousemove",b),document.addEventListener("mouseup",x)}),f.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var A=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];var w=35;this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var a=e||window.event,t=(w-a.clientY+i(A))/w;t=t>0?t:0,t=t<1?t:1,n.volume(t)}),this.volumeicon.addEventListener("click",function(){n.audio.muted?(n.audio.muted=!1,n.volumeicon.className=1===n.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===n.audio.volume?(n.volumeicon.className="aplayer-icon aplayer-icon-volume-up",n.volumeicon.innerHTML=n.getSVG("volume-up")):(n.volumeicon.className="aplayer-icon aplayer-icon-volume-down",n.volumeicon.innerHTML=n.getSVG("volume-down")),n.updateBar("volume",n.audio.volume,"height")):(n.audio.muted=!0,n.volumeicon.className="aplayer-icon aplayer-icon-volume-off",n.volumeicon.innerHTML=n.getSVG("volume-off"),n.updateBar("volume",0,"height"))});var E=this.element.getElementsByClassName("aplayer-icon-loop")[0];E.addEventListener("click",function(){n.loop?(E.classList.add("aplayer-noloop"),n.loop=!1,n.audio.loop=!n.multiple&&n.loop):(E.classList.remove("aplayer-noloop"),n.loop=!0,n.audio.loop=!n.multiple&&n.loop)}),this.multiple&&!function(){var e=n.element.getElementsByClassName("aplayer-list")[0];e.style.height=e.offsetHeight+"px",n.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){e.classList.contains("aplayer-list-hide")?e.classList.remove("aplayer-list-hide"):e.classList.add("aplayer-list-hide")})}(),this.setMusic(0),r.push(this)}return i(e,[{key:"setMusic",value:function(e){var a=this;this.multiple&&"undefined"!=typeof e&&(this.playIndex=e);var t=this.playIndex;if(this.music=this.multiple?this.option.music[t]:this.option.music,this.music.pic&&(this.element.getElementsByClassName("aplayer-pic")[0].style.backgroundImage="url('"+this.music.pic+"')"),this.element.getElementsByClassName("aplayer-title")[0].innerHTML=this.music.title,this.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - "+this.music.author,this.multiple&&(this.element.getElementsByClassName("aplayer-list-light")[0]&&this.element.getElementsByClassName("aplayer-list-light")[0].classList.remove("aplayer-list-light"),this.element.getElementsByClassName("aplayer-list")[0].getElementsByTagName("li")[t].classList.add("aplayer-list-light")),this.audio&&(this.pause(),this.audio.currentTime=0),this.multiple&&!this.audios[t]||this.playIndex===-1?(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.option.preload?this.audio.preload=this.option.preload:this.audio.preload=this.isMobile?"none":"metadata",this.audio.addEventListener("durationchange",function(){1!==a.audio.duration&&(a.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=a.secondToTime(a.audio.duration))}),this.audio.addEventListener("progress",function(){var e=a.audio.buffered.length?a.audio.buffered.end(a.audio.buffered.length-1)/a.audio.duration:0;a.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){a.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",a.trigger("pause")}),this.audio.addEventListener("canplay",function(){a.trigger("canplay")}),this.ended=!1,this.multiple?this.audio.addEventListener("ended",function(){return a.isMobile?(a.ended=!0,void a.pause()):void(0!==a.audio.currentTime&&(a.playIndex"+this.lrc[i][1]+"";this.lrcContents.innerHTML=l,this.lrcIndex||(this.lrcIndex=0),this.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),this.lrcContents.style.transform="translateY(0px)",this.lrcContents.style.webkitTransform="translateY(0px)"}1!==this.audio.duration&&(this.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=this.audio.duration?this.secondToTime(this.audio.duration):"00:00"),this.option.autoplay&&!this.isMobile&&this.play(),this.option.autoplay=!0,this.isMobile&&this.pause()}},{key:"play",value:function(e){var a=this;if("[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused){if(this.button.classList.remove("aplayer-play"),this.button.classList.add("aplayer-pause"),this.button.innerHTML="",setTimeout(function(){a.button.innerHTML='\n "},100),this.option.mutex)for(var t=0;t'+e.getSVG("play")+" "},100),this.audio.pause(),clearInterval(this.playedTime),this.trigger("pause"))}},{key:"volume",value:function(e){this.updateBar("volume",e,"height"),this.audio.volume=e,this.audio.muted&&(this.audio.muted=!1),1===e?(this.volumeicon.className="aplayer-icon aplayer-icon-volume-up",this.volumeicon.innerHTML=this.getSVG("volume-up")):(this.volumeicon.className="aplayer-icon aplayer-icon-volume-down",this.volumeicon.innerHTML=this.getSVG("volume-down"))}},{key:"on",value:function(e,a){"function"==typeof a&&this.event[e].push(a)}},{key:"toggle",value:function(){this.audio.paused?this.play():this.pause()}}]),e}();a.APlayer=n},function(e,a,t){var l=t(2);"string"==typeof l&&(l=[[e.id,l,""]]);t(5)(l,{});l.locals&&(e.exports=l.locals)},function(e,a,t){a=e.exports=t(3)(),a.push([e.id,".aplayer-narrow{width:66px}.aplayer-narrow .aplayer-info{display:none}.aplayer-withlrc.aplayer-narrow{width:106px}.aplayer-withlrc.aplayer .aplayer-pic{height:106px;width:106px}.aplayer-withlrc.aplayer .aplayer-info{margin-left:106px;height:106px}.aplayer-withlrc.aplayer .aplayer-lrc{display:block}.aplayer{font-family:Arial,Helvetica,sans-serif;margin:5px;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);border-radius:2px;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:normal}.aplayer *{box-sizing:content-box}.aplayer .aplayer-icon{width:15px;height:15px;border:none;background-color:transparent;outline:none;cursor:pointer;opacity:.8;vertical-align:middle;padding:0}.aplayer .aplayer-icon .aplayer-fill{-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.aplayer .aplayer-lrc-content{display:none}.aplayer .aplayer-pic{position:relative;float:left;height:66px;width:66px;background-image:url("+t(4)+");background-size:100%;-webkit-transition:all .3s ease;transition:all .3s ease}.aplayer .aplayer-pic .aplayer-button{position:absolute;border-radius:50%;opacity:.8;cursor:pointer;text-shadow:0 1px 1px rgba(0,0,0,.2);box-shadow:0 1px 1px rgba(0,0,0,.2);background:rgba(0,0,0,.2);-webkit-transition:all .1s ease;transition:all .1s ease}.aplayer .aplayer-pic .aplayer-button:hover{opacity:1}.aplayer .aplayer-pic .aplayer-button .aplayer-fill{fill:#fff}.aplayer .aplayer-pic .aplayer-hide{display:none}.aplayer .aplayer-pic .aplayer-play{width:26px;height:26px;border:2px solid #fff;bottom:50%;right:50%;margin:0 -15px -15px 0}.aplayer .aplayer-pic .aplayer-play .aplayer-icon-play{position:absolute;top:3px;left:4px;height:20px;width:20px}.aplayer .aplayer-pic .aplayer-pause{width:16px;height:16px;border:2px solid #fff;bottom:4px;right:4px}.aplayer .aplayer-pic .aplayer-pause .aplayer-icon-pause{position:absolute;top:2px;left:2px;height:12px;width:12px}.aplayer .aplayer-info{margin-left:66px;padding:14px 7px 0 10px;height:66px;box-sizing:border-box}.aplayer .aplayer-info .aplayer-music{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;margin-bottom:13px}.aplayer .aplayer-info .aplayer-music .aplayer-title{font-size:14px}.aplayer .aplayer-info .aplayer-music .aplayer-author{font-size:12px;color:#666}.aplayer .aplayer-info .aplayer-controller{position:relative}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap{margin:0 140px 0 5px;padding:4px 0;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar{position:relative;height:2px;width:100%;background:#cdcdcd}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded{position:absolute;left:0;top:0;bottom:0;background:#aaa;height:2px;-webkit-transition:all .5s ease;transition:all .5s ease}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played{position:absolute;left:0;top:0;bottom:0;height:2px}.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:8px;width:8px;border-radius:50%;background:#fff;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-time{position:absolute;right:0;bottom:-3px;height:17px;color:#999;font-size:11px}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner{vertical-align:middle}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon{cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill{fill:#666}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-loop{margin-right:4px}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-noloop .aplayer-fill{fill:#ddd}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-noloop:hover .aplayer-fill{fill:#bbb}.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill{fill:#000}.aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-loop,.aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu{display:none}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap{position:relative;display:inline-block;margin-left:3px;cursor:pointer!important}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-volume-bar-wrap{display:block}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap{display:none;position:absolute;bottom:15px;right:-3px;width:25px;height:40px;z-index:99}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar{position:absolute;bottom:0;right:10px;width:5px;height:35px;background:#aaa}.aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume{position:absolute;bottom:0;right:0;width:5px;-webkit-transition:all .1s ease;transition:all .1s ease}.aplayer .aplayer-lrc{display:none;position:relative;height:40px;background:#fff;text-align:center;overflow:hidden;margin:-10px 0 10px}.aplayer .aplayer-lrc:before{top:0;height:10%;background:-webkit-linear-gradient(top,#fff,hsla(0,0%,100%,0));background:-webkit-gradient(linear,left top,left bottom,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(180deg,#fff 0,hsla(0,0%,100%,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#00ffffff',GradientType=0)}.aplayer .aplayer-lrc:after,.aplayer .aplayer-lrc:before{position:absolute;z-index:1;display:block;overflow:hidden;width:100%;content:' '}.aplayer .aplayer-lrc:after{bottom:0;height:33%;background:-webkit-linear-gradient(bottom,#fff,hsla(0,0%,100%,0));background:-webkit-gradient(linear,left bottom,left top,from(#fff),to(hsla(0,0%,100%,0)));background:linear-gradient(0deg,#fff 0,hsla(0,0%,100%,0));filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffffff',endColorstr='#ffffff',GradientType=0)}.aplayer .aplayer-lrc p{font-size:12px;color:#666;line-height:20px!important;height:20px!important;padding:0!important;margin:0!important;-webkit-transition:all .5s ease-out;transition:all .5s ease-out;opacity:.4;overflow:hidden}.aplayer .aplayer-lrc p.aplayer-lrc-current{opacity:1}.aplayer .aplayer-lrc .aplayer-lrc-contents{width:100%;-webkit-transition:all .5s ease-out;transition:all .5s ease-out}.aplayer .aplayer-list{overflow:auto;-webkit-transition:all .5s ease;transition:all .5s ease}.aplayer .aplayer-list.aplayer-list-hide{height:0!important}.aplayer .aplayer-list ol{list-style-type:none;margin:0;padding:0}.aplayer .aplayer-list ol li{position:relative;height:32px;line-height:32px;padding:0 15px;font-size:12px;border-top:1px solid #e9e9e9;cursor:pointer;-webkit-transition:all .2s ease;transition:all .2s ease;overflow:hidden}.aplayer .aplayer-list ol li:hover{background:#efefef}.aplayer .aplayer-list ol li.aplayer-list-light{background:#e9e9e9}.aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-cur{display:inline-block}.aplayer .aplayer-list ol li .aplayer-list-cur{display:none;width:3px;height:22px;position:absolute;left:0;top:5px;cursor:pointer}.aplayer .aplayer-list ol li .aplayer-list-index{color:#666;margin-right:12px;cursor:pointer}.aplayer .aplayer-list ol li .aplayer-list-author{color:#666;float:right;cursor:pointer}@-webkit-keyframes aplayer-roll{0%{left:0}to{left:-100%}}@keyframes aplayer-roll{0%{left:0}to{left:-100%}}",""])},function(e,a){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],a=0;a=0&&b.splice(a,1)}function o(e){var a=document.createElement("style");return a.type="text/css",r(e,a),a}function s(e){var a=document.createElement("link");return a.rel="stylesheet",r(e,a),a}function p(e,a){var t,l,i;if(a.singleton){var r=g++;t=v||(v=o(a)),l=u.bind(null,t,r,!1),i=u.bind(null,t,r,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=s(a),l=d.bind(null,t),i=function(){n(t),t.href&&URL.revokeObjectURL(t.href)}):(t=o(a),l=c.bind(null,t),i=function(){n(t)});return l(e),function(a){if(a){if(a.css===e.css&&a.media===e.media&&a.sourceMap===e.sourceMap)return;l(e=a)}else i()}}function u(e,a,t,l){var i=t?"":l.css;if(e.styleSheet)e.styleSheet.cssText=x(a,i);else{var r=document.createTextNode(i),n=e.childNodes;n[a]&&e.removeChild(n[a]),n.length?e.insertBefore(r,n[a]):e.appendChild(r)}}function c(e,a){var t=a.css,l=a.media;if(l&&e.setAttribute("media",l),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}function d(e,a){var t=a.css,l=a.sourceMap;l&&(t+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(l))))+" */");var i=new Blob([t],{type:"text/css"}),r=e.href;e.href=URL.createObjectURL(i),r&&URL.revokeObjectURL(r)}var y={},h=function(e){var a;return function(){return"undefined"==typeof a&&(a=e.apply(this,arguments)),a}},m=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),f=h(function(){return document.head||document.getElementsByTagName("head")[0]}),v=null,g=0,b=[];e.exports=function(e,a){a=a||{},"undefined"==typeof a.singleton&&(a.singleton=m()),"undefined"==typeof a.insertAt&&(a.insertAt="bottom");var t=i(e);return l(t,a),function(e){for(var r=[],n=0;n\\n \\n \\n \\n ';\n\t };\n\t\n\t this.isMobile = /mobile/i.test(window.navigator.userAgent);\n\t // compatibility: some mobile browsers don't suppose autoplay\n\t if (this.isMobile) {\n\t option.autoplay = false;\n\t }\n\t\n\t // default options\n\t var defaultOption = {\n\t element: document.getElementsByClassName('aplayer')[0],\n\t narrow: false,\n\t autoplay: false,\n\t mutex: true,\n\t showlrc: 0,\n\t theme: '#b7daff',\n\t loop: true\n\t };\n\t for (var defaultKey in defaultOption) {\n\t if (defaultOption.hasOwnProperty(defaultKey) && !option.hasOwnProperty(defaultKey)) {\n\t option[defaultKey] = defaultOption[defaultKey];\n\t }\n\t }\n\t\n\t // multiple music\n\t this.playIndex = Object.prototype.toString.call(option.music) === '[object Array]' ? 0 : -1;\n\t\n\t this.option = option;\n\t this.audios = [];\n\t this.loop = option.loop;\n\t\n\t /**\n\t * Parse second to 00:00 format\n\t *\n\t * @param {Number} second\n\t * @return {String} 00:00 format\n\t */\n\t this.secondToTime = function (second) {\n\t var add0 = function add0(num) {\n\t return num < 10 ? '0' + num : '' + num;\n\t };\n\t var min = parseInt(second / 60);\n\t var sec = parseInt(second - min * 60);\n\t return add0(min) + ':' + add0(sec);\n\t };\n\t\n\t /**\n\t * Parse lrc, suppose multiple time tag\n\t *\n\t * @param {Array} arr - Format:\n\t * [mm:ss.xx]lyric\n\t * [mm:ss.xxx]lyric\n\t * [mm:ss.xx][mm:ss.xx][mm:ss.xx]lyric\n\t *\n\t * @return {Array} [[[time, text], [time, text], [time, text], ...], [[time, text], [time, text], [time, text], ...], ...]\n\t */\n\t this.parseLrc = function (arr) {\n\t var lrcs = [];\n\t for (var k = 0; k < arr.length; k++) {\n\t var lyric = arr[k].split('\\n');\n\t var lrc = [];\n\t var lyricLen = lyric.length;\n\t for (var i = 0; i < lyricLen; i++) {\n\t // match lrc time\n\t var lrcTimes = lyric[i].match(/\\[(\\d{2}):(\\d{2})\\.(\\d{2,3})]/g);\n\t // match lrc text\n\t var lrcText = lyric[i].replace(/\\[(\\d{2}):(\\d{2})\\.(\\d{2,3})]/g, '').replace(/^\\s+|\\s+$/g, '');\n\t\n\t if (lrcTimes != null) {\n\t // handle multiple time tag\n\t var timeLen = lrcTimes.length;\n\t for (var j = 0; j < timeLen; j++) {\n\t var oneTime = /\\[(\\d{2}):(\\d{2})\\.(\\d{2,3})]/.exec(lrcTimes[j]);\n\t var lrcTime = oneTime[1] * 60 + parseInt(oneTime[2]) + parseInt(oneTime[3]) / ((oneTime[3] + '').length === 2 ? 100 : 1000);\n\t lrc.push([lrcTime, lrcText]);\n\t }\n\t }\n\t }\n\t // sort by time\n\t lrc.sort(function (a, b) {\n\t return a[0] - b[0];\n\t });\n\t lrcs.push(lrc);\n\t }\n\t return lrcs;\n\t };\n\t\n\t /**\n\t * Update progress bar, including loading progress bar and play progress bar\n\t *\n\t * @param {String} type - Point out which bar it is, should be played loaded or volume\n\t * @param {Number} percentage\n\t * @param {String} direction - Point out the direction of this bar, Should be height or width\n\t */\n\t this.updateBar = function (type, percentage, direction) {\n\t percentage = percentage > 0 ? percentage : 0;\n\t percentage = percentage < 1 ? percentage : 1;\n\t _this[type + 'Bar'].style[direction] = percentage * 100 + '%';\n\t };\n\t\n\t /**\n\t * Update lrc\n\t *\n\t * @param {Number} currentTime\n\t */\n\t this.updateLrc = function () {\n\t var currentTime = arguments.length <= 0 || arguments[0] === undefined ? _this.audio.currentTime : arguments[0];\n\t\n\t if (_this.lrcIndex > _this.lrc.length - 1 || currentTime < _this.lrc[_this.lrcIndex][0] || !_this.lrc[_this.lrcIndex + 1] || currentTime >= _this.lrc[_this.lrcIndex + 1][0]) {\n\t for (var i = 0; i < _this.lrc.length; i++) {\n\t if (currentTime >= _this.lrc[i][0] && (!_this.lrc[i + 1] || currentTime < _this.lrc[i + 1][0])) {\n\t _this.lrcIndex = i;\n\t _this.lrcContents.style.transform = 'translateY(' + -_this.lrcIndex * 20 + 'px)';\n\t _this.lrcContents.style.webkitTransform = 'translateY(' + -_this.lrcIndex * 20 + 'px)';\n\t _this.lrcContents.getElementsByClassName('aplayer-lrc-current')[0].classList.remove('aplayer-lrc-current');\n\t _this.lrcContents.getElementsByTagName('p')[i].classList.add('aplayer-lrc-current');\n\t }\n\t }\n\t }\n\t };\n\t\n\t // define APlayer events\n\t this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];\n\t this.event = {};\n\t for (var i = 0; i < this.eventTypes.length; i++) {\n\t this.event[this.eventTypes[i]] = [];\n\t }\n\t this.trigger = function (type) {\n\t for (var _i = 0; _i < _this.event[type].length; _i++) {\n\t _this.event[type][_i]();\n\t }\n\t };\n\t }\n\t\n\t /**\n\t * AutoLink initialization function\n\t */\n\t\n\t\n\t _createClass(APlayer, [{\n\t key: 'init',\n\t value: function init() {\n\t var _this2 = this;\n\t\n\t this.element = this.option.element;\n\t this.multiple = this.playIndex > -1;\n\t this.music = this.multiple ? this.option.music[this.playIndex] : this.option.music;\n\t\n\t var i = void 0;\n\t // parser lrc\n\t if (this.option.showlrc) {\n\t var lrcs = [];\n\t if (this.option.showlrc === 1) {\n\t if (this.multiple) {\n\t for (i = 0; i < this.option.music.length; i++) {\n\t lrcs.push(this.option.music[i].lrc);\n\t }\n\t } else {\n\t lrcs.push(this.option.music.lrc);\n\t }\n\t } else if (this.option.showlrc === 2 || this.option.showlrc === true) {\n\t for (i = 0; i < this.element.getElementsByClassName('aplayer-lrc-content').length; i++) {\n\t lrcs.push(this.element.getElementsByClassName('aplayer-lrc-content')[i].innerHTML);\n\t }\n\t }\n\t\n\t this.lrcs = this.parseLrc(lrcs);\n\t }\n\t\n\t // add class aplayer-withlrc\n\t if (this.option.showlrc) {\n\t this.element.classList.add('aplayer-withlrc');\n\t }\n\t\n\t // fill in HTML\n\t var eleHTML = '\\n \\n
\\n \\n
\\n
\\n \\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n - 00:00 / 00:00\\n \\n
\\n
\\n
\\n
\\n
\\n ' + (this.multiple ? '
' : '') + '\\n
\\n
\\n
');\n\t if (this.multiple) {\n\t eleHTML += '\\n \\n
';\n\t for (i = 0; i < this.option.music.length; i++) {\n\t eleHTML += '\\n - \\n \\n ' + (i + 1) + '\\n ' + this.option.music[i].title + '\\n ' + this.option.music[i].author + '\\n
';\n\t }\n\t eleHTML += '\\n
\\n
';\n\t }\n\t this.element.innerHTML = eleHTML;\n\t\n\t // hide loop button in arrow container\n\t if (this.element.offsetWidth < 300) {\n\t this.element.getElementsByClassName('aplayer-icon-loop')[0].style.display = 'none';\n\t }\n\t\n\t this.ptime = this.element.getElementsByClassName('aplayer-ptime')[0];\n\t\n\t if (this.element.getElementsByClassName('aplayer-info')[0].offsetWidth < 200) {\n\t this.element.getElementsByClassName('aplayer-time')[0].classList.add('aplayer-time-narrow');\n\t }\n\t // fix the width of aplayer bar\n\t this.bar = this.element.getElementsByClassName('aplayer-bar-wrap')[0];\n\t this.bar.style.marginRight = this.element.getElementsByClassName('aplayer-time')[0].offsetWidth + 5 + 'px';\n\t\n\t // switch to narrow style\n\t if (this.option.narrow) {\n\t this.element.classList.add('aplayer-narrow');\n\t }\n\t\n\t // play and pause button\n\t this.button = this.element.getElementsByClassName('aplayer-button')[0];\n\t this.button.addEventListener('click', function (e) {\n\t if (_this2.button.classList.contains('aplayer-play')) {\n\t _this2.play();\n\t } else if (_this2.button.classList.contains('aplayer-pause')) {\n\t _this2.pause();\n\t }\n\t });\n\t\n\t // click music list: change music\n\t if (this.multiple) {\n\t (function () {\n\t var listItem = _this2.element.getElementsByClassName('aplayer-list')[0].getElementsByTagName('li');\n\t\n\t var _loop = function _loop(_i2) {\n\t listItem[_i2].addEventListener('click', function () {\n\t var musicIndex = parseInt(listItem[_i2].getElementsByClassName('aplayer-list-index')[0].innerHTML) - 1;\n\t if (musicIndex !== _this2.playIndex) {\n\t _this2.setMusic(musicIndex);\n\t if (_this2.isMobile) {\n\t _this2.pause();\n\t } else {\n\t _this2.play();\n\t }\n\t } else {\n\t _this2.toggle();\n\t }\n\t });\n\t };\n\t\n\t for (var _i2 = 0; _i2 < _this2.option.music.length; _i2++) {\n\t _loop(_i2);\n\t }\n\t })();\n\t }\n\t\n\t // control play progress\n\t this.playedBar = this.element.getElementsByClassName('aplayer-played')[0];\n\t this.loadedBar = this.element.getElementsByClassName('aplayer-loaded')[0];\n\t this.thumb = this.element.getElementsByClassName('aplayer-thumb')[0];\n\t var barWidth = void 0;\n\t this.bar.addEventListener('click', function (event) {\n\t var e = event || window.event;\n\t barWidth = _this2.bar.clientWidth;\n\t var percentage = (e.clientX - getElementViewLeft(_this2.bar)) / barWidth;\n\t _this2.updateBar('played', percentage, 'width');\n\t _this2.element.getElementsByClassName('aplayer-ptime')[0].innerHTML = _this2.secondToTime(percentage * _this2.audio.duration);\n\t _this2.audio.currentTime = parseFloat(_this2.playedBar.style.width) / 100 * _this2.audio.duration;\n\t });\n\t\n\t this.thumb.addEventListener('mouseover', function () {\n\t _this2.thumb.style.background = _this2.option.theme;\n\t });\n\t this.thumb.addEventListener('mouseout', function () {\n\t _this2.thumb.style.background = '#fff';\n\t });\n\t\n\t var thumbMove = function thumbMove(event) {\n\t var e = event || window.event;\n\t var percentage = (e.clientX - getElementViewLeft(_this2.bar)) / barWidth;\n\t percentage = percentage > 0 ? percentage : 0;\n\t percentage = percentage < 1 ? percentage : 1;\n\t _this2.updateBar('played', percentage, 'width');\n\t if (_this2.option.showlrc) {\n\t _this2.updateLrc(parseFloat(_this2.playedBar.style.width) / 100 * _this2.audio.duration);\n\t }\n\t _this2.element.getElementsByClassName('aplayer-ptime')[0].innerHTML = _this2.secondToTime(percentage * _this2.audio.duration);\n\t };\n\t\n\t var thumbUp = function thumbUp() {\n\t document.removeEventListener('mouseup', thumbUp);\n\t document.removeEventListener('mousemove', thumbMove);\n\t _this2.audio.currentTime = parseFloat(_this2.playedBar.style.width) / 100 * _this2.audio.duration;\n\t _this2.playedTime = setInterval(function () {\n\t _this2.updateBar('played', _this2.audio.currentTime / _this2.audio.duration, 'width');\n\t if (_this2.option.showlrc) {\n\t _this2.updateLrc();\n\t }\n\t _this2.element.getElementsByClassName('aplayer-ptime')[0].innerHTML = _this2.secondToTime(_this2.audio.currentTime);\n\t _this2.trigger('playing');\n\t }, 100);\n\t };\n\t\n\t this.thumb.addEventListener('mousedown', function () {\n\t barWidth = _this2.bar.clientWidth;\n\t clearInterval(_this2.playedTime);\n\t document.addEventListener('mousemove', thumbMove);\n\t document.addEventListener('mouseup', thumbUp);\n\t });\n\t\n\t // control volume\n\t this.volumeBar = this.element.getElementsByClassName('aplayer-volume')[0];\n\t var volumeBarWrap = this.element.getElementsByClassName('aplayer-volume-bar')[0];\n\t this.volumeicon = this.element.getElementsByClassName('aplayer-time')[0].getElementsByTagName('button')[0];\n\t var barHeight = 35;\n\t this.element.getElementsByClassName('aplayer-volume-bar-wrap')[0].addEventListener('click', function (event) {\n\t var e = event || window.event;\n\t var percentage = (barHeight - e.clientY + getElementViewTop(volumeBarWrap)) / barHeight;\n\t percentage = percentage > 0 ? percentage : 0;\n\t percentage = percentage < 1 ? percentage : 1;\n\t _this2.volume(percentage);\n\t });\n\t this.volumeicon.addEventListener('click', function () {\n\t if (_this2.audio.muted) {\n\t _this2.audio.muted = false;\n\t _this2.volumeicon.className = _this2.audio.volume === 1 ? 'aplayer-icon aplayer-icon-volume-up' : 'aplayer-icon aplayer-icon-volume-down';\n\t if (_this2.audio.volume === 1) {\n\t _this2.volumeicon.className = 'aplayer-icon aplayer-icon-volume-up';\n\t _this2.volumeicon.innerHTML = _this2.getSVG('volume-up');\n\t } else {\n\t _this2.volumeicon.className = 'aplayer-icon aplayer-icon-volume-down';\n\t _this2.volumeicon.innerHTML = _this2.getSVG('volume-down');\n\t }\n\t _this2.updateBar('volume', _this2.audio.volume, 'height');\n\t } else {\n\t _this2.audio.muted = true;\n\t _this2.volumeicon.className = 'aplayer-icon aplayer-icon-volume-off';\n\t _this2.volumeicon.innerHTML = _this2.getSVG('volume-off');\n\t _this2.updateBar('volume', 0, 'height');\n\t }\n\t });\n\t\n\t // get element's view position\n\t function getElementViewLeft(element) {\n\t var actualLeft = element.offsetLeft;\n\t var current = element.offsetParent;\n\t var elementScrollLeft = void 0;\n\t while (current !== null) {\n\t actualLeft += current.offsetLeft;\n\t current = current.offsetParent;\n\t }\n\t elementScrollLeft = document.body.scrollLeft + document.documentElement.scrollLeft;\n\t return actualLeft - elementScrollLeft;\n\t }\n\t\n\t function getElementViewTop(element) {\n\t var actualTop = element.offsetTop;\n\t var current = element.offsetParent;\n\t var elementScrollTop = void 0;\n\t while (current !== null) {\n\t actualTop += current.offsetTop;\n\t current = current.offsetParent;\n\t }\n\t elementScrollTop = document.body.scrollTop + document.documentElement.scrollTop;\n\t return actualTop - elementScrollTop;\n\t }\n\t\n\t // loop control\n\t var loopEle = this.element.getElementsByClassName('aplayer-icon-loop')[0];\n\t loopEle.addEventListener('click', function () {\n\t if (_this2.loop) {\n\t loopEle.classList.add('aplayer-noloop');\n\t _this2.loop = false;\n\t _this2.audio.loop = _this2.multiple ? false : _this2.loop;\n\t } else {\n\t loopEle.classList.remove('aplayer-noloop');\n\t _this2.loop = true;\n\t _this2.audio.loop = _this2.multiple ? false : _this2.loop;\n\t }\n\t });\n\t\n\t // toggle menu control\n\t if (this.multiple) {\n\t (function () {\n\t var list = _this2.element.getElementsByClassName('aplayer-list')[0];\n\t list.style.height = list.offsetHeight + 'px';\n\t _this2.element.getElementsByClassName('aplayer-icon-menu')[0].addEventListener('click', function () {\n\t if (!list.classList.contains('aplayer-list-hide')) {\n\t list.classList.add('aplayer-list-hide');\n\t } else {\n\t list.classList.remove('aplayer-list-hide');\n\t }\n\t });\n\t })();\n\t }\n\t\n\t this.setMusic(0);\n\t\n\t instances.push(this);\n\t }\n\t\n\t /**\n\t * Set music\n\t */\n\t\n\t }, {\n\t key: 'setMusic',\n\t value: function setMusic(index) {\n\t var _this3 = this;\n\t\n\t // get this.music\n\t if (this.multiple && typeof index !== 'undefined') {\n\t this.playIndex = index;\n\t }\n\t var indexMusic = this.playIndex;\n\t this.music = this.multiple ? this.option.music[indexMusic] : this.option.music;\n\t\n\t // set html\n\t if (this.music.pic) {\n\t this.element.getElementsByClassName('aplayer-pic')[0].style.backgroundImage = 'url(\\'' + this.music.pic + '\\')';\n\t }\n\t this.element.getElementsByClassName('aplayer-title')[0].innerHTML = this.music.title;\n\t this.element.getElementsByClassName('aplayer-author')[0].innerHTML = ' - ' + this.music.author;\n\t if (this.multiple) {\n\t if (this.element.getElementsByClassName('aplayer-list-light')[0]) {\n\t this.element.getElementsByClassName('aplayer-list-light')[0].classList.remove('aplayer-list-light');\n\t }\n\t this.element.getElementsByClassName('aplayer-list')[0].getElementsByTagName('li')[indexMusic].classList.add('aplayer-list-light');\n\t }\n\t\n\t // set the previous audio object\n\t if (this.audio) {\n\t this.pause();\n\t this.audio.currentTime = 0;\n\t }\n\t\n\t // get this audio object\n\t if (this.multiple && !this.audios[indexMusic] || this.playIndex === -1) {\n\t this.audio = document.createElement(\"audio\");\n\t this.audio.src = this.music.url;\n\t if (this.option.preload) {\n\t this.audio.preload = this.option.preload;\n\t } else {\n\t this.audio.preload = this.isMobile ? 'none' : 'metadata';\n\t }\n\t\n\t // show audio time: the metadata has loaded or changed\n\t this.audio.addEventListener('durationchange', function () {\n\t if (_this3.audio.duration !== 1) {\n\t // compatibility: Android browsers will output 1 at first\n\t _this3.element.getElementsByClassName('aplayer-dtime')[0].innerHTML = _this3.secondToTime(_this3.audio.duration);\n\t }\n\t });\n\t\n\t // show audio loaded bar: to inform interested parties of progress downloading the media\n\t this.audio.addEventListener('progress', function () {\n\t var percentage = _this3.audio.buffered.length ? _this3.audio.buffered.end(_this3.audio.buffered.length - 1) / _this3.audio.duration : 0;\n\t _this3.updateBar('loaded', percentage, 'width');\n\t });\n\t\n\t // audio download error: an error occurs\n\t this.audio.addEventListener('error', function () {\n\t _this3.element.getElementsByClassName('aplayer-author')[0].innerHTML = ' - Error happens ╥﹏╥';\n\t _this3.trigger('pause');\n\t });\n\t\n\t // audio can play: enough data is available that the media can be played\n\t this.audio.addEventListener('canplay', function () {\n\t _this3.trigger('canplay');\n\t });\n\t\n\t // multiple music play\n\t this.ended = false;\n\t if (this.multiple) {\n\t this.audio.addEventListener('ended', function () {\n\t if (_this3.isMobile) {\n\t _this3.ended = true;\n\t _this3.pause();\n\t return;\n\t }\n\t if (_this3.audio.currentTime !== 0) {\n\t if (_this3.playIndex < _this3.option.music.length - 1) {\n\t _this3.setMusic(++_this3.playIndex);\n\t } else if (_this3.loop) {\n\t _this3.setMusic(0);\n\t } else if (!_this3.loop) {\n\t _this3.ended = true;\n\t _this3.pause();\n\t _this3.trigger('ended');\n\t }\n\t }\n\t });\n\t } else {\n\t this.audio.addEventListener('ended', function () {\n\t if (!_this3.loop) {\n\t _this3.ended = true;\n\t _this3.pause();\n\t _this3.trigger('ended');\n\t }\n\t });\n\t }\n\t\n\t // control volume\n\t this.audio.volume = parseInt(this.element.getElementsByClassName('aplayer-volume')[0].style.height) / 100;\n\t\n\t // loop\n\t this.audio.loop = this.multiple ? false : this.loop;\n\t\n\t if (this.multiple) {\n\t this.audios[indexMusic] = this.audio;\n\t }\n\t } else {\n\t this.audio = this.audios[indexMusic];\n\t this.audio.volume = parseInt(this.element.getElementsByClassName('aplayer-volume')[0].style.height) / 100;\n\t this.audio.currentTime = 0;\n\t }\n\t\n\t // fill in lrc\n\t if (this.option.showlrc) {\n\t this.lrc = this.multiple ? this.lrcs[indexMusic] : this.lrcs[0];\n\t var lrcHTML = '';\n\t this.lrcContents = this.element.getElementsByClassName('aplayer-lrc-contents')[0];\n\t for (var i = 0; i < this.lrc.length; i++) {\n\t lrcHTML += '' + this.lrc[i][1] + '
';\n\t }\n\t this.lrcContents.innerHTML = lrcHTML;\n\t if (!this.lrcIndex) {\n\t this.lrcIndex = 0;\n\t }\n\t this.lrcContents.getElementsByTagName('p')[0].classList.add('aplayer-lrc-current');\n\t this.lrcContents.style.transform = 'translateY(0px)';\n\t this.lrcContents.style.webkitTransform = 'translateY(0px)';\n\t }\n\t\n\t // set duration time\n\t if (this.audio.duration !== 1) {\n\t // compatibility: Android browsers will output 1 at first\n\t this.element.getElementsByClassName('aplayer-dtime')[0].innerHTML = this.audio.duration ? this.secondToTime(this.audio.duration) : '00:00';\n\t }\n\t\n\t // autoplay\n\t if (this.option.autoplay && !this.isMobile) {\n\t this.play();\n\t }\n\t this.option.autoplay = true; // autoplay next music\n\t\n\t if (this.isMobile) {\n\t this.pause();\n\t }\n\t }\n\t\n\t /**\n\t * Play music\n\t */\n\t\n\t }, {\n\t key: 'play',\n\t value: function play(time) {\n\t var _this4 = this;\n\t\n\t if (Object.prototype.toString.call(time) === '[object Number]') {\n\t this.audio.currentTime = time;\n\t }\n\t if (this.audio.paused) {\n\t this.button.classList.remove('aplayer-play');\n\t this.button.classList.add('aplayer-pause');\n\t this.button.innerHTML = '';\n\t setTimeout(function () {\n\t _this4.button.innerHTML = '\\n ';\n\t }, 100);\n\t\n\t // pause other players (Thanks @Aprikyblue)\n\t if (this.option.mutex) {\n\t for (var i = 0; i < instances.length; i++) {\n\t if (this != instances[i]) {\n\t instances[i].pause();\n\t }\n\t }\n\t }\n\t this.audio.play();\n\t if (this.playedTime) {\n\t clearInterval(this.playedTime);\n\t }\n\t this.playedTime = setInterval(function () {\n\t _this4.updateBar('played', _this4.audio.currentTime / _this4.audio.duration, 'width');\n\t if (_this4.option.showlrc) {\n\t _this4.updateLrc();\n\t }\n\t _this4.ptime.innerHTML = _this4.secondToTime(_this4.audio.currentTime);\n\t _this4.trigger('playing');\n\t }, 100);\n\t this.trigger('play');\n\t }\n\t }\n\t\n\t /**\n\t * Pause music\n\t */\n\t\n\t }, {\n\t key: 'pause',\n\t value: function pause() {\n\t var _this5 = this;\n\t\n\t if (!this.audio.paused || this.ended) {\n\t this.ended = false;\n\t this.button.classList.remove('aplayer-pause');\n\t this.button.classList.add('aplayer-play');\n\t this.button.innerHTML = '';\n\t setTimeout(function () {\n\t _this5.button.innerHTML = '\\n ';\n\t }, 100);\n\t this.audio.pause();\n\t clearInterval(this.playedTime);\n\t this.trigger('pause');\n\t }\n\t }\n\t\n\t /**\n\t * Set volume\n\t */\n\t\n\t }, {\n\t key: 'volume',\n\t value: function volume(percentage) {\n\t this.updateBar('volume', percentage, 'height');\n\t this.audio.volume = percentage;\n\t if (this.audio.muted) {\n\t this.audio.muted = false;\n\t }\n\t if (percentage === 1) {\n\t this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-up';\n\t this.volumeicon.innerHTML = this.getSVG('volume-up');\n\t } else {\n\t this.volumeicon.className = 'aplayer-icon aplayer-icon-volume-down';\n\t this.volumeicon.innerHTML = this.getSVG('volume-down');\n\t }\n\t }\n\t\n\t /**\n\t * attach event\n\t */\n\t\n\t }, {\n\t key: 'on',\n\t value: function on(name, func) {\n\t if (typeof func === 'function') {\n\t this.event[name].push(func);\n\t }\n\t }\n\t\n\t /**\n\t * toggle between play and pause\n\t */\n\t\n\t }, {\n\t key: 'toggle',\n\t value: function toggle() {\n\t if (this.audio.paused) {\n\t this.play();\n\t } else {\n\t this.pause();\n\t }\n\t }\n\t }]);\n\t\n\t return APlayer;\n\t}();\n\t\n\texports.APlayer = APlayer;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// style-loader: Adds some css to the DOM by adding a