diff --git a/Action.php b/Action.php
index fc1faf0..ab7ceeb 100644
--- a/Action.php
+++ b/Action.php
@@ -1,206 +1,320 @@
on($this->request->is('do=update'))->update();
$this->on($this->request->is('do=parse'))->shortcode();
$this->on($this->request->isGet())->api();
}
- private function check($a,$b){
- if(!in_array($a,array('netease','tencent','baidu','xiami','kugou')))return false;
- if(!in_array($b,array('song','album','search','artist','playlist','lrc','url','pic')))return false;
+ private function check($a, $b)
+ {
+ if (!in_array($a, array('netease','tencent','baidu','xiami','kugou'))) {
+ return false;
+ }
+ if (!in_array($b, array('song','album','search','artist','playlist','lrc','url','pic'))) {
+ return false;
+ }
return true;
}
- private function api(){
+ private function api()
+ {
$this->filterReferer();
- $server=$this->request->get('server');
- $type=$this->request->get('type');
- $id=$this->request->get('id');
+ $server = $this->request->get('server');
+ $type = $this->request->get('type');
+ $id = $this->request->get('id');
- if(!$this->check($server,$type)||empty($id))die('[]');
+ if (!$this->check($server, $type) || empty($id)) {
+ die('[]');
+ }
- if(!extension_loaded('Meting'))include_once 'include/Meting.php';
- $api=new \Metowolf\Meting($server);
+ if (!extension_loaded('Meting')) {
+ include_once 'include/Meting.php';
+ }
+ $api = new \Metowolf\Meting($server);
$api->format(true);
- $EID=md5($server.'/'.$type.'/'.$id);
- $salt=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->salt;
+ if (!extension_loaded('Meting')) {
+ $cachetype = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cachetype;
+ if ($cachetype != 'none') {
+ $cachehost = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cachehost;
+ $cacheport = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cacheport;
+ include_once 'driver/cache.interface.php';
+ include_once 'driver/'.$cachetype.'.class.php';
+ $this->cache = new MetingCache(array(
+ 'host' => $cachehost,
+ 'port' => $cacheport
+ ));
+ }
+ }
+ $api = new \Metowolf\Meting($server);
+ $api->format(true);
+ $cookie = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cookie;
+ if ($server == 'netease' && !empty($cookie)) {
+ $api->cookie($cookie);
+ }
- if(in_array($type,array('lrc','pic','url'))){
- $auth1=md5($salt.$id.$salt);
- $auth2=$this->request->get('auth');
- if(strcmp($auth1,$auth2)){
+ $EID = $server.'/'.$type.'/'.$id;
+ $salt = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->salt;
+
+ if (!empty($salt) && in_array($type, array('lrc','pic','url'))) {
+ $auth1 = md5($salt.$type.$id.$salt);
+ $auth2 = $this->request->get('auth');
+ if (strcmp($auth1, $auth2)) {
http_response_code(403);
die();
}
}
- if($type=='lrc'){
- $data=$this->cacheRead($EID,60*60*24);
- if(empty($data)){
- $data=$api->lyric($id);
- $this->cacheWrite($EID,$data);
+ if ($type == 'lrc') {
+ $data = $this->cacheRead($EID);
+ if (empty($data)) {
+ $data = $api->lyric($id);
+ $this->cacheWrite($EID, $data, 86400);
}
- $data=json_decode($data,true);
+ $data = json_decode($data, true);
header("Content-Type: application/javascript");
echo $data['lyric'];
- }
- elseif($type=='pic'){
- $data=$this->cacheRead($EID,60*60*24);
- if(empty($data)){
- $data=$api->pic($id,90);
- $this->cacheWrite($EID,$data);
+ } elseif ($type == 'pic') {
+ $data = $this->cacheRead($EID);
+ if (empty($data)) {
+ $data = $api->pic($id, 90);
+ $this->cacheWrite($EID, $data, 86400);
}
- $data=json_decode($data,true);
+ $data = json_decode($data, true);
$this->response->redirect($data['url']);
- }
- elseif($type=='url'){
- $data=$this->cacheRead($EID,60*15);
- if(empty($data)){
- $rate=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->bitrate;
- $cookie=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->cookie;
- if($server=='netease'&&!empty($cookie))$api->cookie($cookie);
- $data=$api->url($id,$rate);
- $this->cacheWrite($EID,$data);
+ } elseif ($type == 'url') {
+ $data = $this->cacheRead($EID);
+ if (empty($data)) {
+ $rate = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->bitrate;
+ $data = $api->url($id, $rate);
+ $this->cacheWrite($EID, $data, 1200);
}
- $data=json_decode($data,true);
- $url=$data['url'];
+ $data = json_decode($data, true);
+ $url = $data['url'];
- if($server=='netease'){
- $url=str_replace('://m7c.','://m8.',$url);
- $url=str_replace('://m8c.','://m8.',$url);
- $url=str_replace('http://m8.','https://m8.',$url);
- $url=str_replace('http://m7.','https://m8.',$url);
- $url=str_replace('http://m10.','https://m10.',$url);
+ if ($server == 'netease') {
+ $url = str_replace('://m7c.', '://m7.', $url);
+ $url = str_replace('://m8c.', '://m8.', $url);
+ $url = str_replace('http://m8.', 'https://m9.', $url);
+ $url = str_replace('http://m7.', 'https://m9.', $url);
+ $url = str_replace('http://m10.', 'https://m10.', $url);
}
- if(empty($url))$url='https://api.i-meto.com/Public/music/empty.mp3';
+ if ($server == 'baidu') {
+ $url = str_replace('http://zhangmenshiting.qianqian.com', 'https://gss3.baidu.com/y0s1hSulBw92lNKgpU_Z2jR7b2w6buu', $url);
+ }
+
+ if (empty($url)) {
+ $url = 'https://coding.meting.api.i-meto.com/empty.mp3';
+ if ($server == 'netease') {
+ $url = 'https://music.163.com/song/media/outer/url?id='.$id.'.mp3';
+ }
+ }
$this->response->redirect($url);
- }
- else{
- $data=$this->cacheRead($EID,60*60*2);
- if(empty($data)){
- $data=$api->$type($id);
- $this->cacheWrite($EID,$data);
+ } else {
+ $data = $this->cacheRead($EID);
+ if (empty($data)) {
+ $data = $api->$type($id);
+ $this->cacheWrite($EID, $data, 7200);
}
- $data=json_decode($data,1);
- $url=Typecho_Common::url('action/metingapi',Helper::options()->index);
+ $data = json_decode($data, 1);
+ $url = Typecho_Common::url('action/metingapi', Helper::options()->index);
- $music=array();
- foreach($data as $vo){
- $music[]=array(
- 'title' => $vo['name'],
- 'author' => implode(' / ',$vo['artist']),
- 'url' => $url.'?server='.$vo['source'].'&type=url&id='.$vo['url_id'].'&auth='.md5($salt.$vo['url_id'].$salt),
- 'pic' => $url.'?server='.$vo['source'].'&type=pic&id='.$vo['pic_id'].'&auth='.md5($salt.$vo['pic_id'].$salt),
- 'lrc' => $url.'?server='.$vo['source'].'&type=lrc&id='.$vo['lyric_id'].'&auth='.md5($salt.$vo['lyric_id'].$salt),
+ $music = array();
+ foreach ($data as $vo) {
+ $music[] = array(
+ 'title' => $vo['name'],
+ 'author' => implode(' / ', $vo['artist']),
+ 'url' => $url.'?server='.$vo['source'].'&type=url&id='.$vo['url_id'].'&auth='.md5($salt.'url'.$vo['url_id'].$salt),
+ 'pic' => $url.'?server='.$vo['source'].'&type=pic&id='.$vo['pic_id'].'&auth='.md5($salt.'pic'.$vo['pic_id'].$salt),
+ 'lrc' => $url.'?server='.$vo['source'].'&type=lrc&id='.$vo['lyric_id'].'&auth='.md5($salt.'lrc'.$vo['lyric_id'].$salt),
);
}
header("Content-Type: application/javascript");
echo json_encode($music);
}
-
}
- private function shortcode(){
- $url=$this->request->get('data');
- $url=trim($url);
- if(empty($url))return;
- $server='netease';$id='';$type='';
- if(strpos($url,'163.com')!==false){
- $server='netease';
- if(preg_match('/playlist\?id=(\d+)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/toplist\?id=(\d+)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/album\?id=(\d+)/i',$url,$id))list($id,$type)=array($id[1],'album');
- elseif(preg_match('/song\?id=(\d+)/i',$url,$id))list($id,$type)=array($id[1],'song');
- elseif(preg_match('/artist\?id=(\d+)/i',$url,$id))list($id,$type)=array($id[1],'artist');
- }
- elseif(strpos($url,'qq.com')!==false){
- $server='tencent';
- if(preg_match('/playlist\/([^\.]*)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/album\/([^\.]*)/i',$url,$id))list($id,$type)=array($id[1],'album');
- elseif(preg_match('/song\/([^\.]*)/i',$url,$id))list($id,$type)=array($id[1],'song');
- elseif(preg_match('/singer\/([^\.]*)/i',$url,$id))list($id,$type)=array($id[1],'artist');
- }
- elseif(strpos($url,'xiami.com')!==false){
- $server='xiami';
- if(preg_match('/collect\/(\w+)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/album\/(\w+)/i',$url,$id))list($id,$type)=array($id[1],'album');
- elseif(preg_match('/[\/.]\w+\/[songdem]+\/(\w+)/i',$url,$id))list($id,$type)=array($id[1],'song');
- elseif(preg_match('/artist\/(\w+)/i',$url,$id))list($id,$type)=array($id[1],'artist');
- if(!preg_match('/^\d*$/i',$id,$t)){
- $data=self::curl($url);
- preg_match('/'.$type.'\/(\d+)/i',$data,$id);
- $id=$id[1];
- }
- }
- elseif(strpos($url,'kugou.com')!==false){
- $server='kugou';
- if(preg_match('/special\/single\/(\d+)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/song\/#hash\=(\w+)/i',$url,$id))list($id,$type)=array($id[1],'song');
- elseif(preg_match('/album\/[single\/]*(\d+)/i',$url,$id))list($id,$type)=array($id[1],'album');
- elseif(preg_match('/singer\/[home\/]*(\d+)/i',$url,$id))list($id,$type)=array($id[1],'artist');
- }
- elseif(strpos($url,'baidu.com')!==false){
- $server='baidu';
- if(preg_match('/songlist\/(\d+)/i',$url,$id))list($id,$type)=array($id[1],'playlist');
- elseif(preg_match('/album\/(\d+)/i',$url,$id))list($id,$type)=array($id[1],'album');
- elseif(preg_match('/song\/(\d+)/i',$url,$id))list($id,$type)=array($id[1],'song');
- elseif(preg_match('/artist\/(\d+)/i',$url,$id))list($id,$type)=array($id[1],'artist');
- }
- else{
- echo "[Meting]\n[Music title=\"歌曲名\" author=\"歌手\" url=\"{$url}\" pic=\"图片文件URL\" lrc=\"歌词文件URL\"/]\n[/Meting]\n";
+ private function shortcode()
+ {
+ $url = $this->request->get('data');
+ $url = trim($url);
+ if (empty($url)) {
return;
}
- echo "[Meting]\n[Music server=\"{$server}\" id=\"{$id}\" type=\"{$type}\"/]\n[/Meting]\n";
+ $server = 'netease';
+ $id = '';
+ $type = '';
+ if (strpos($url, '163.com') !== false) {
+ $server = 'netease';
+ if (preg_match('/playlist\?id=(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/toplist\?id=(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/album\?id=(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'album');
+ } elseif (preg_match('/song\?id=(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'song');
+ } elseif (preg_match('/artist\?id=(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'artist');
+ }
+ } elseif (strpos($url, 'qq.com') !== false) {
+ $server = 'tencent';
+ if (preg_match('/playsquare\/([^\.]*)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/album\/([^\.]*)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'album');
+ } elseif (preg_match('/song\/([^\.]*)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'song');
+ } elseif (preg_match('/singer\/([^\.]*)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'artist');
+ }
+ } elseif (strpos($url, 'xiami.com') !== false) {
+ $server = 'xiami';
+ if (preg_match('/collect\/(\w+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/album\/(\w+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'album');
+ } elseif (preg_match('/[\/.]\w+\/[songdem]+\/(\w+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'song');
+ } elseif (preg_match('/artist\/(\w+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'artist');
+ }
+ if (!preg_match('/^\d*$/i', $id, $t)) {
+ $data = self::curl($url);
+ preg_match('/'.$type.'\/(\d+)/i', $data, $id);
+ $id = $id[1];
+ }
+ } elseif (strpos($url, 'kugou.com') !== false) {
+ $server = 'kugou';
+ if (preg_match('/special\/single\/(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/#hash\=(\w+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'song');
+ } elseif (preg_match('/album\/[single\/]*(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'album');
+ } elseif (preg_match('/singer\/[home\/]*(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'artist');
+ }
+ } elseif (strpos($url, 'baidu.com') !== false) {
+ $server = 'baidu';
+ if (preg_match('/songlist\/(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'playlist');
+ } elseif (preg_match('/album\/(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'album');
+ } elseif (preg_match('/song\/(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'song');
+ } elseif (preg_match('/artist\/(\d+)/i', $url, $id)) {
+ list($id, $type) = array($id[1],'artist');
+ }
+ } else {
+ die("[Meting]\n[Music title=\"歌曲名\" author=\"歌手\" url=\"{$url}\" pic=\"图片文件URL\" lrc=\"歌词文件URL\"/]\n[/Meting]\n");
+ return;
+ }
+ die("[Meting]\n[Music server=\"{$server}\" id=\"{$id}\" type=\"{$type}\"/]\n[/Meting]\n");
+
}
- private function curl($url){
- $curl=curl_init();
- curl_setopt($curl,CURLOPT_URL,$url);
- curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($curl,CURLOPT_CONNECTTIMEOUT,10);
- curl_setopt($curl,CURLOPT_TIMEOUT,10);
- curl_setopt($curl,CURLOPT_REFERER,$url);
- $result=curl_exec($curl);
+ private function update()
+ {
+ $isAdmin = call_user_func(function () {
+ $hasLogin = $this->widget('Widget_User')->hasLogin();
+ $isAdmin = false;
+ if (!$hasLogin) {
+ return false;
+ }
+ $isAdmin = $this->widget('Widget_User')->pass('administrator', true);
+ return $isAdmin;
+ }, $this);
+ if (!$isAdmin) {
+ die('非管理员,禁止操作!');
+ }
+
+ header("Content-Type: application/javascript");
+
+ $shasum = $this->curl('https://raw.githubusercontent.com/MoePlayer/APlayer-Typecho/master/shasum.txt');
+
+ echo "获取最新特征库...\n";
+ echo $shasum."\n\n";
+
+ $shasum = explode("\n", $shasum);
+ array_pop($shasum);
+
+ echo "开始检查本地文件...\n";
+
+ foreach ($shasum as $remote) {
+ list($remote_sha256, $filename) = explode(' ', $remote);
+ if (!file_exists(__DIR__.'/'.$filename)) {
+ continue;
+ }
+ $local_sha256 = hash('sha256', file_get_contents(__DIR__.'/'.$filename));
+ if (!hash_equals($local_sha256, $remote_sha256)) {
+ echo "下载 ".$filename;
+ $url = 'https://raw.githubusercontent.com/MoePlayer/APlayer-Typecho/master'.substr($filename, 1);
+
+ if (file_put_contents(__DIR__.'/'.$filename, $this->curl($url))) {
+ echo " (OK)\n";
+ } else {
+ die("\n下载失败,错误信息: $url\n");
+ }
+ } else {
+ echo "无需更新 ".$filename."\n";
+ }
+ }
+
+ echo "\n\n如果插件出现错误,建议禁用再启用一次插件完成升级。";
+ die();
+ }
+
+ private function curl($url)
+ {
+ $curl = curl_init();
+ curl_setopt($curl, CURLOPT_URL, $url);
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
+ curl_setopt($curl, CURLOPT_TIMEOUT, 10);
+ curl_setopt($curl, CURLOPT_REFERER, $url);
+ $result = curl_exec($curl);
curl_close($curl);
return $result;
}
- private function cacheWrite($k,$v){
- if(empty($v)||is_null($v))return;
- $db=Typecho_Db::get();
- $insert=$db->insert('table.metingv1')->rows(array('id'=>md5($k),'value'=>$v,'last'=>time()));
- return $db->query($insert);
+ private function cacheWrite($k, $v, $t)
+ {
+ if (!isset($this->cache)) {
+ return;
+ }
+ return $this->cache->set($k, $v, $t);
}
- private function cacheRead($k,$t=3600){
- $db=Typecho_Db::get();
- $query=$db->select('value','last')->from('table.metingv1')->where('id=?',md5($k));
- $result=$db->fetchRow($query);
-
- if(isset($result['value'])){
- if(time()-$result['last']>$t){
- $delete=$db->delete('table.metingv1')->where('last',time()-$t);
- $db->query($delete);
- return false;
- }
- header("Meting-Cache: HIT");
- return $result['value'];
- }
- else{
- header("Meting-Cache: MISS");
+ private function cacheRead($k)
+ {
+ if (!isset($this->cache)) {
return false;
}
+ return $this->cache->get($k);
}
- private function filterReferer(){
- if(isset($_SERVER['HTTP_REFERER'])&&strpos($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST'])===false){
+ private function filterReferer()
+ {
+ $salt = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->salt;
+ if (empty($salt)) {
+ header("Access-Control-Allow-Origin: *");
+ header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Connection, User-Agent, Cookie");
+ return;
+ }
+ if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) === false) {
http_response_code(403);
die('[]');
}
diff --git a/LICENSE b/LICENSE
index 1a5c137..81809b5 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2017 METO
+Copyright (c) 2018 METO
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Plugin.php b/Plugin.php
index fb29b37..46c0465 100644
--- a/Plugin.php
+++ b/Plugin.php
@@ -1,18 +1,20 @@
contentEx=array('Meting_Plugin','playerReplace');
- Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx=array('Meting_Plugin','playerReplace');
- Typecho_Plugin::factory('Widget_Archive')->header=array('Meting_Plugin','header');
- Typecho_Plugin::factory('Widget_Archive')->footer=array('Meting_Plugin','footer');
+ Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('Meting_Plugin','playerReplace');
+ Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('Meting_Plugin','playerReplace');
+ Typecho_Plugin::factory('Widget_Archive')->header = array('Meting_Plugin','header');
+ Typecho_Plugin::factory('Widget_Archive')->footer = array('Meting_Plugin','footer');
Typecho_Plugin::factory('admin/write-post.php')->bottom = array('Meting_Plugin', 'addButton');
Typecho_Plugin::factory('admin/write-page.php')->bottom = array('Meting_Plugin', 'addButton');
}
@@ -42,8 +45,8 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
* @return void
* @throws Typecho_Plugin_Exception
*/
- public static function deactivate(){
- Meting_Plugin::uninstall();
+ public static function deactivate()
+ {
Helper::removeAction("metingapi");
}
@@ -54,56 +57,114 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
* @param Typecho_Widget_Helper_Form $form 配置面板
* @return void
*/
- public static function config(Typecho_Widget_Helper_Form $form){
+ public static function config(Typecho_Widget_Helper_Form $form)
+ {
$t = new Typecho_Widget_Helper_Form_Element_Text(
- 'theme', null, '#ad7a86',
+ 'theme',
+ null,
+ '#ad7a86',
_t('播放器颜色'),
- _t('播放器默认的主题颜色,支持如 #372e21、#75c、red,该设定会被[Meting]标签中的theme属性覆盖,默认为 #ad7a86'));
+ _t('播放器默认的主题颜色,支持如 #372e21、#75c、red,该设定会被[Meting]标签中的theme属性覆盖,默认为 #ad7a86')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Text(
- 'height', null, '340px',
+ 'height',
+ null,
+ '340px',
_t('播放器列表最大高度'),
- _t(''));
+ _t('')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Radio(
- 'autoplay', array('true'=>_t('是'),'false'=>_t('否')),'false',
+ 'autoplay',
+ array('true' => _t('是'),'false' => _t('否')),
+ 'false',
_t('全局自动播放'),
- _t(''));
+ _t('')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Radio(
- 'mode', array('circulation'=>_t('循环'),'single'=>_t('单曲'),'order'=>_t('列表'),'random'=>_t('随机')),'circulation',
+ 'mode',
+ array('circulation' => _t('循环'),'single' => _t('单曲'),'order' => _t('列表'),'random' => _t('随机')),
+ 'circulation',
_t('全局播放模式'),
- _t(''));
+ _t('')
+ );
$form->addInput($t);
- $t= new Typecho_Widget_Helper_Form_Element_Radio(
- 'preload', array('auto'=>_t('自动'),'none'=>_t('不加载'),'metadata'=>_t('加载元数据')), 'auto',
+ $t = new Typecho_Widget_Helper_Form_Element_Radio(
+ 'preload',
+ array('auto' => _t('自动'),'none' => _t('不加载'),'metadata' => _t('加载元数据')),
+ 'auto',
_t('预加载属性'),
- _t(''));
+ _t('')
+ );
$form->addInput($t);
- $t= new Typecho_Widget_Helper_Form_Element_Radio(
- 'bitrate', array('128'=>_t('流畅品质'),'192'=>_t('清晰品质'),'320'=>_t('高品质')), '192',
+
+ $list = array(
+ 'none' => _t('关闭'),
+ 'redis' => _t('Redis'),
+ 'mysql' => _t('Mysql'),
+ 'sqlite' => _t('SQLite')
+ );
+ $t = new Typecho_Widget_Helper_Form_Element_Radio(
+ 'cachetype',
+ $list,
+ 'none',
+ _t('缓存驱动'),
+ _t('缓存歌曲解析信息,降低服务器压力')
+ );
+ $form->addInput($t);
+ $t = new Typecho_Widget_Helper_Form_Element_Text(
+ 'cachehost',
+ null,
+ '127.0.0.1',
+ _t('缓存服务地址'),
+ _t('通常为 localhost, 127.0.0.1')
+ );
+ $form->addInput($t);
+ $t = new Typecho_Widget_Helper_Form_Element_Text(
+ 'cacheport',
+ null,
+ '6379',
+ _t('缓存服务端口'),
+ _t('默认端口 memcache: 11211, Redis: 6379, Mysql: 3306')
+ );
+ $form->addInput($t);
+
+ $t = new Typecho_Widget_Helper_Form_Element_Radio(
+ 'bitrate',
+ array('128' => _t('流畅品质 128K'),'192' => _t('清晰品质 192K'),'320' => _t('高品质 320K')),
+ '192',
_t('默认音质'),
- _t(''));
+ _t('')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Text(
- 'api', null, Typecho_Common::url('action/metingapi',Helper::options()->index)."?server=:server&type=:type&id=:id&r=:r",
- _t('云解析地址'),
- _t('示例:https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r'));
+ 'api',
+ null,
+ Typecho_Common::url('action/metingapi', Helper::options()->index)."?server=:server&type=:type&id=:id&r=:r",
+ _t('* 云解析地址'),
+ _t('示例:https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Text(
- 'salt', null, md5(time()."Meting"),
- _t('接口保护'),
- _t('加盐保护 API 接口不被滥用,自动生成无需设置。'));
+ 'salt',
+ null,
+ Typecho_Common::randString(32),
+ _t('* 接口保护'),
+ _t('加盐保护 API 接口不被滥用,自动生成无需设置。')
+ );
$form->addInput($t);
$t = new Typecho_Widget_Helper_Form_Element_Textarea(
- 'cookie', null, '',
- _t('网易云音乐 Cookie (高级)'),
- _t('如果您是网易云音乐的会员,可以将您的 cookie 填入此处来获取云盘等付费资源,听歌将不会计入下载次数。
如果不知道这是什么意思,忽略即可。'));
- $form->addInput($t);
- $t = new Typecho_Widget_Helper_Form_Element_Radio(
- 'clean', array(_t('关闭'), _t('清除所有缓存')), 0,
- _t('保存时清除所有缓存'));
+ 'cookie',
+ null,
+ '',
+ _t('* 网易云音乐 Cookie'),
+ _t('如果您是网易云音乐的会员,可以将您的 cookie 填入此处来获取云盘等付费资源,听歌将不会计入下载次数。
如果不知道这是什么意思,忽略即可。')
+ );
$form->addInput($t);
+
+ echo '';
}
/**
@@ -113,20 +174,32 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
*/
public static function configHandle($config, $is_init)
{
- if($is_init!=true){
- if($config['api']==""){
- $config['api']=Typecho_Common::url('action/metingapi',Helper::options()->index)."?server=:server&type=:type&id=:id&r=:r";
+ if (!$is_init) {
+ if (empty($config['api'])) {
+ $config['api'] = Typecho_Common::url('action/metingapi', Helper::options()->index)."?server=:server&type=:type&id=:id&r=:r";
}
- if($config['clean']==1){
- self::clean();
- $config['clean']=0;
+ if ($config['cachetype'] != 'none') {
+ require_once 'driver/cache.interface.php';
+ require_once 'driver/'.$config['cachetype'].'.class.php';
+ try {
+ $cache = new MetingCache(array(
+ 'host' => $config['cachehost'],
+ 'port' => $config['cacheport']
+ ));
+ $cache->install();
+ $cache->flush();
+ } catch (Exception $e) {
+ throw new Typecho_Plugin_Exception(_t($e->getMessage()));
+ }
}
}
Helper::configPlugin('Meting', $config);
}
- public static function personalConfig(Typecho_Widget_Helper_Form $form){}
+ public static function personalConfig(Typecho_Widget_Helper_Form $form)
+ {
+ }
/**
* 获取插件配置面板
@@ -135,100 +208,125 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
* @param Typecho_Widget_Helper_Form $form 配置面板
* @return void
*/
- public static function header(){
- $api=Typecho_Widget::widget('Widget_Options')->plugin('Meting')->api;
- $dir=Helper::options()->pluginUrl.'/Meting/assets';
- $ver=METING_VERSION;
+ public static function header()
+ {
+ $api = Typecho_Widget::widget('Widget_Options')->plugin('Meting')->api;
+ $dir = Helper::options()->pluginUrl.'/Meting/assets';
+ $ver = METING_VERSION;
echo "\n";
echo "";
}
- public static function footer(){
- $dir=Helper::options()->pluginUrl.'/Meting/assets';
- $ver=METING_VERSION;
+ public static function footer()
+ {
+ $dir = Helper::options()->pluginUrl.'/Meting/assets';
+ $ver = METING_VERSION;
echo "\n";
}
- public static function playerReplace($data,$widget,$last){
- $text=empty($last)?$data:$last;
- if($widget instanceof Widget_Archive){
- $data=$text;
- $pattern=self::get_shortcode_regex(array('Meting'));
- $text=preg_replace_callback("/$pattern/",array('Meting_Plugin','parseCallback'),$data);
+ public static function playerReplace($data, $widget, $last)
+ {
+ $text = empty($last)?$data:$last;
+ if ($widget instanceof Widget_Archive) {
+ $data = $text;
+ $pattern = self::get_shortcode_regex(array('Meting'));
+ $text = preg_replace_callback("/$pattern/", array('Meting_Plugin','parseCallback'), $data);
}
return $text;
}
- public static function parseCallback($matches){
- $setting=self::shortcode_parse_atts(htmlspecialchars_decode($matches[3]));
- $matches[5]=htmlspecialchars_decode($matches[5]);
- $pattern=self::get_shortcode_regex(array('Music'));
- preg_match_all("/$pattern/",$matches[5],$all);
- if(sizeof($all[3]))return Meting_Plugin::parseMusic($all[3],$setting);
+ public static function parseCallback($matches)
+ {
+ $setting = self::shortcode_parse_atts(htmlspecialchars_decode($matches[3]));
+ $matches[5] = htmlspecialchars_decode($matches[5]);
+ $pattern = self::get_shortcode_regex(array('Music'));
+ preg_match_all("/$pattern/", $matches[5], $all);
+ if (sizeof($all[3])) {
+ return Meting_Plugin::parseMusic($all[3], $setting);
+ }
}
- public static function parseMusic($matches,$setting){
- $data=array();
- $str="";
- foreach($matches as $vo){
- $t=self::shortcode_parse_atts(htmlspecialchars_decode($vo));
- $player=array(
- 'theme' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->theme?:'red',
- 'preload' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->preload?:'auto',
- 'autoplay' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->autoplay?:'false',
+ public static function parseMusic($matches, $setting)
+ {
+ $data = array();
+ $str = "";
+ foreach ($matches as $vo) {
+ $t = self::shortcode_parse_atts(htmlspecialchars_decode($vo));
+ $player = array(
+ 'theme' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->theme?:'red',
+ 'preload' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->preload?:'auto',
+ 'autoplay' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->autoplay?:'false',
'listmaxheight' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->height?:'340px',
- 'mode' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->mode?:'circulation',
+ 'mode' => Typecho_Widget::widget('Widget_Options')->plugin('Meting')->mode?:'circulation',
);
- if(isset($t['server'])){
- if(!in_array($t['server'],array('netease','tencent','xiami','baidu','kugou')))continue;
- if(!in_array($t['type'],array('search','album','playlist','artist','song')))continue;
- $data=$t;
+ if (isset($t['server'])) {
+ if (!in_array($t['server'], array('netease','tencent','xiami','baidu','kugou'))) {
+ continue;
+ }
+ if (!in_array($t['type'], array('search','album','playlist','artist','song'))) {
+ continue;
+ }
+ $data = $t;
- $str.="
$vo)$player[$key]=$vo;
- foreach($player as $key=>$vo)$str.=" data-{$key}=\"{$vo}\"";
- $str.=">
\n";
- }
- else{
- $data=$t;
+ $str .= " $vo) {
+ $player[$key] = $vo;
+ }
+ }
+ foreach ($player as $key => $vo) {
+ $str .= " data-{$key}=\"{$vo}\"";
+ }
+ $str .= ">
\n";
+ } else {
+ $data = $t;
- $str.="$vo)$player[$key]=$vo;
- foreach($player as $key=>$vo)$str.=" data-{$key}=\"{$vo}\"";
- $str.=">
\n";
+ $str .= " $vo) {
+ $player[$key] = $vo;
+ }
+ }
+ foreach ($player as $key => $vo) {
+ $str .= " data-{$key}=\"{$vo}\"";
+ }
+ $str .= ">
\n";
}
}
return $str;
}
- public static function addButton(){
- $url=Typecho_Common::url('action/metingapi',Helper::options()->index).'?do=parse';
- $dir=Helper::options()->pluginUrl.'/Meting/assets/editer.js?v='.METING_VERSION;
- echo "
+ public static function addButton()
+ {
+ $url = Typecho_Common::url('action/metingapi', Helper::options()->index).'?do=parse';
+ $dir = Helper::options()->pluginUrl.'/Meting/assets/editer.js?v='.METING_VERSION;
+ echo "
";
}
# https://github.com/WordPress/WordPress/blob/master/wp-includes/shortcodes.php#L508
- private static function shortcode_parse_atts($text) {
+ private static function shortcode_parse_atts($text)
+ {
$atts = array();
$pattern = '/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w-]+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
- if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
+ if (preg_match_all($pattern, $text, $match, PREG_SET_ORDER)) {
foreach ($match as $m) {
- if (!empty($m[1]))
+ if (!empty($m[1])) {
$atts[strtolower($m[1])] = stripcslashes($m[2]);
- elseif (!empty($m[3]))
- $atts[strtolower($m[3])] = stripcslashes($m[4]);
- elseif (!empty($m[5]))
- $atts[strtolower($m[5])] = stripcslashes($m[6]);
- elseif (isset($m[7]) && strlen($m[7]))
- $atts[] = stripcslashes($m[7]);
- elseif (isset($m[8]))
- $atts[] = stripcslashes($m[8]);
+ } elseif (!empty($m[3])) {
+ $atts[strtolower($m[3])] = stripcslashes($m[4]);
+ } elseif (!empty($m[5])) {
+ $atts[strtolower($m[5])] = stripcslashes($m[6]);
+ } elseif (isset($m[7]) && strlen($m[7])) {
+ $atts[] = stripcslashes($m[7]);
+ } elseif (isset($m[8])) {
+ $atts[] = stripcslashes($m[8]);
+ }
}
- foreach( $atts as &$value ) {
- if ( false !== strpos( $value, '<' ) ) {
- if ( 1 !== preg_match( '/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value ) ) {
+ foreach ($atts as &$value) {
+ if (false !== strpos($value, '<')) {
+ if (1 !== preg_match('/^[^<]*+(?:<[^>]*+>[^<]*+)*+$/', $value)) {
$value = '';
}
}
@@ -240,41 +338,19 @@ class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
}
# https://github.com/WordPress/WordPress/blob/master/wp-includes/shortcodes.php#L254
- private static function get_shortcode_regex( $tagnames = null ) {
- $tagregexp = join( '|', array_map('preg_quote', $tagnames) );
+ private static function get_shortcode_regex($tagnames = null)
+ {
+ $tagregexp = join('|', array_map('preg_quote', $tagnames));
return '\[(\[?)('.$tagregexp.')(?![\w-])([^\]\/]*(?:\/(?!\])[^\]\/]*)*?)(?:(\/)\]|\](?:([^\[]*+(?:\[(?!\/\2\])[^\[]*+)*+)\[\/\2\])?)(\]?)';
}
- public static function install(){
- $db=Typecho_Db::get();
- $dbname=$db->getPrefix().'metingv1';
- try{
- $db->query("CREATE TABLE IF NOT EXISTS {$dbname} (
- id VARCHAR(32) PRIMARY KEY NOT NULL UNIQUE,
- value TEXT NOT NULL,
- last int NOT NULL
- )");
- }catch(Typecho_Db_Exception $e){
- $code=$e->getCode();
- throw new Typecho_Plugin_Exception('插件启用失败。错误号:'.$code);
+ public static function installCheck()
+ {
+ if (!extension_loaded('curl')) {
+ throw new Typecho_Plugin_Exception(_t('缺少 cURL 拓展'));
}
- }
-
- private function clean(){
- $db=Typecho_Db::get();
- $dbname=$db->getPrefix().'metingv1';
- $delete=$db->delete($dbname);
- $db->query($delete);
- }
-
- public static function uninstall(){
- $db=Typecho_Db::get();
- $dbname=$db->getPrefix().'metingv1';
- try{
- $db->query("DROP TABLE IF EXISTS {$dbname}");
- }catch(Typecho_Db_Exception $e){
- $code=$e->getCode();
- throw new Typecho_Plugin_Exception('插件禁用失败。错误号:'.$code);
+ if (!(extension_loaded('openssl') || extension_loaded('mcrypt'))) {
+ throw new Typecho_Plugin_Exception(_t('缺少 openssl/mcrypt 拓展'));
}
}
}
diff --git a/README.md b/README.md
index 6eddad5..f639ea5 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,7 @@
-# APlayer for Typecho
-在 Typecho 中使用 APlayer 播放在线音乐吧~
+ > 在 Typecho 中使用 APlayer 播放在线音乐吧~
[发布页面](https://i-meto.com/meting-typecho/)
## 介绍
@@ -11,8 +10,9 @@
2. 简单快捷,复制音乐详情页面网址,后台自动生成播放代码
3. 前端 APlayer,后端 Meting 及时更新,保证兼容性及 API 高可用性
4. 支持 MySql、SQLite 数据库
- 5. 支持自定义歌曲播放
- 6. **自定义 API 支持**
+ 5. **支持 Redis 缓存**
+ 6. 支持自定义歌曲播放
+ 7. **自定义 API 支持**
## 声明
本作品仅供个人学习研究使用,请勿将其用作商业用途。
@@ -35,11 +35,11 @@
- 歌单 http://music.163.com/#/playlist?id=436843836
- 榜单 http://music.163.com/#/discover/toplist?id=60198
-QQ 音乐 http://y.qq.com
-- 单曲 https://y.qq.com/portal/song/000jDQWP4JiB3y.html
-- 专辑 https://y.qq.com/portal/album/003rytri2FHG3V.html
-- 歌手 https://y.qq.com/portal/singer/003Nz2So3XXYek.html
-- 歌单 https://y.qq.com/portal/playlist/1144188779.html
+QQ 音乐 https://y.qq.com
+- 单曲 https://y.qq.com/n/yqq/song/000jDQWP4JiB3y.html
+- 专辑 https://y.qq.com/n/yqq/album/003rytri2FHG3V.html
+- 歌手 https://y.qq.com/n/yqq/singer/003Nz2So3XXYek.html
+- 歌单 https://y.qq.com/n/yqq/playlist/1144188779.html
虾米音乐 http://www.xiami.com or http://h.xiami.com
- 单曲 http://www.xiami.com/song/bf08DNT3035f
@@ -48,7 +48,7 @@ QQ 音乐 http://y.qq.com
- 歌单 http://www.xiami.com/collect/254478782
酷狗音乐 http://www.kugou.com
-- 单曲 暂不支持直接解析,可直接修改短代码实现
+- 单曲 http://www.kugou.com/song/#hash=09E8DE70A24C97B92A29F6A19F3528A2
- 专辑 http://www.kugou.com/yy/album/single/1645030.html
- 歌手 http://www.kugou.com/yy/singer/home/3520.html
- 歌单 http://www.kugou.com/yy/special/single/119859.html
@@ -60,9 +60,21 @@ QQ 音乐 http://y.qq.com
- 歌单 http://music.baidu.com/songlist/364201689
## FAQ
-Q: 如何清除歌单、歌词缓存?
-A: 为了减少服务器压力,插件设置对歌单、歌词数据进行缓存,缓存会根据时间周期自动更新管理,无需人工干预。**如果需要强制清除,可以通过禁用再启用插件实现,不影响文章中歌曲信息**
-...
+Q: pjax 页面切换无法停止播放?
+A: 需要另外在主题的回调函数中添加
+```
+if (typeof aplayers !== 'undefined'){
+ for (var i = 0; i < aplayers.length; i++) {
+ try {aplayers[i].destroy()} catch(e){}
+ }
+}
+```
+
+Q: 不支持混合歌单?
+A: 由于 2.0 版本重写了实现方式,旧的混合歌单将不再支持,建议通过各音乐平台创建歌单的方式添加。
+
+Q: 部分歌曲失效?
+A: 可能 API 失效导致的,可以尝试点击插件升级按钮升级到最新,或填写 cookie 信息。
更多问题可以通过 issue 页面提交,或者通过 Telegram、邮件向我反馈
diff --git a/assets/APlayer.min.js b/assets/APlayer.min.js
index eae8e04..a64f448 100644
--- a/assets/APlayer.min.js
+++ b/assets/APlayer.min.js
@@ -1 +1 @@
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("APlayer",[],t):"object"==typeof exports?exports.APlayer=t():e.APlayer=t()}(this,function(){return function(e){function t(n){if(a[n])return a[n].exports;var r=a[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var a={};return t.m=e,t.c=a,t.i=function(e){return e},t.d=function(e,a,n){t.o(e,a)||Object.defineProperty(e,a,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var a=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(a,"a",a),a},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t,a){var n=a(2);"string"==typeof n&&(n=[[e.i,n,""]]);var r={};r.transform=void 0;a(4)(n,r);n.locals&&(e.exports=n.locals)},function(e,t,a){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,a=Array(e.length);t\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(t.autoplay=!1);var s={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",mode:"circulation"};for(var p in s)s.hasOwnProperty(p)&&!t.hasOwnProperty(p)&&(t[p]=s[p]);if(this.option=t,this.audios=[],this.mode=t.mode,this.secondToTime=function(e){if(isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},a=parseInt(e/60),n=parseInt(e-60*a),r=parseInt(a/60),i=parseInt(e/60-60*parseInt(e/60/60));return e>=3600?t(r)+":"+t(i)+":"+t(n):t(a)+":"+t(n)},this.element=this.option.element,2===this.option.showlrc||!0===this.option.showlrc){this.savelrc=[];for(var c=0;c0?t:0,t=t<1?t:1,m[e+"Bar"].style[a]=100*t+"%"},this.updateLrc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.audio.currentTime;if(i.lrcIndex>i.lrc.length-1||e=i.lrc[i.lrcIndex+1][0])for(var t=0;t=i.lrc[t][0]&&(!i.lrc[t+1]||e1&&this.element.classList.add("aplayer-withlist"),this.multiple||"circulation"===this.mode||"order"===this.mode||(this.mode="circulation"),this.getRandomOrder();for(var y='\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 \n
\n
\n
\n \n
',h=0;h\n \n '+(h+1)+'\n '+this.option.music[h].title+'\n '+this.option.music[h].author+"\n ";y+="\n
\n
",this.element.innerHTML=y,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-mode")[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 m={};m.barWrap=this.element.getElementsByClassName("aplayer-bar-wrap")[0],this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){i.toggle()});var f=this.element.getElementsByClassName("aplayer-list")[0];f.addEventListener("click",function(e){var t=void 0;t="LI"===e.target.tagName.toUpperCase()?e.target:e.target.parentElement;var a=parseInt(t.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;a!==i.playIndex?(i.setMusic(a),i.play()):i.toggle()}),m.playedBar=this.element.getElementsByClassName("aplayer-played")[0],m.loadedBar=this.element.getElementsByClassName("aplayer-loaded")[0];var v=this.element.getElementsByClassName("aplayer-thumb")[0],g=void 0;m.barWrap.addEventListener("click",function(e){var t=e||window.event;g=m.barWrap.clientWidth;var n=(t.clientX-a(m.barWrap))/g;isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.updateBar("played",n,"width"),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration),i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration)}),v.addEventListener("mouseover",function(){v.style.background=i.option.theme}),v.addEventListener("mouseout",function(){v.style.background="#fff"});var b=function(e){var t=e||window.event,n=(t.clientX-a(m.barWrap))/g;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.option.showlrc&&i.updateLrc(parseFloat(m.playedBar.style.width)/100*i.audio.duration),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration)},x=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",b),isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration,i.playedTime=setInterval(function(){i.updateBar("played",i.audio.currentTime/i.audio.duration,"width"),i.option.showlrc&&i.updateLrc(),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(i.audio.currentTime),i.trigger("playing")},100))};v.addEventListener("mousedown",function(){g=m.barWrap.clientWidth,clearInterval(i.playedTime),document.addEventListener("mousemove",b),document.addEventListener("mouseup",x)}),m.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var w=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var t=e||window.event,a=(35-t.clientY+n(w))/35;a=a>0?a:0,a=a<1?a:1,i.volume(a)}),this.volumeicon.addEventListener("click",function(){i.audio.muted?(i.audio.muted=!1,i.volumeicon.className=1===i.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===i.audio.volume?(i.volumeicon.className="aplayer-icon aplayer-icon-volume-up",i.volumeicon.innerHTML=i.getSVG("volume-up")):(i.volumeicon.className="aplayer-icon aplayer-icon-volume-down",i.volumeicon.innerHTML=i.getSVG("volume-down")),i.updateBar("volume",i.audio.volume,"height")):(i.audio.muted=!0,i.volumeicon.className="aplayer-icon aplayer-icon-volume-off",i.volumeicon.innerHTML=i.getSVG("volume-off"),i.updateBar("volume",0,"height"))});var A=this.element.getElementsByClassName("aplayer-icon-mode")[0];A.addEventListener("click",function(){i.multiple?"random"===i.mode?i.mode="single":"single"===i.mode?i.mode="order":"order"===i.mode?i.mode="circulation":"circulation"===i.mode&&(i.mode="random"):"circulation"===i.mode?i.mode="order":i.mode="circulation",A.innerHTML=i.getSVG(i.mode),i.audio.loop=!(i.multiple||"order"===i.mode)}),f.style.height=f.offsetHeight+"px",this.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){f.classList.contains("aplayer-list-hide")?f.classList.remove("aplayer-list-hide"):f.classList.add("aplayer-list-hide")}),"random"===this.mode?this.setMusic(this.randomOrder[0]):this.setMusic(0),l.push(this)}return i(e,[{key:"setMusic",value:function(e){var t=this;void 0!==e&&(this.playIndex=e);var a=this.playIndex;this.music=this.option.music[a],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.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")[a].classList.add("aplayer-list-light"),!this.isMobile&&this.audio&&(this.pause(),this.audio.currentTime=0),this.element.getElementsByClassName("aplayer-list")[0].scrollTop=33*a,this.isMobile&&this.audio?(this.audio.src=this.music.url,this.play()):!this.isMobile&&this.audios[a]?(this.audio=this.audios[a],this.audio.volume=parseInt(this.element.getElementsByClassName("aplayer-volume")[0].style.height)/100,this.audio.currentTime=0):(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.audio.preload=this.option.preload?this.option.preload:"auto",this.audio.addEventListener("play",function(){if(t.button.classList.contains("aplayer-play")){if(t.button.classList.remove("aplayer-play"),t.button.classList.add("aplayer-pause"),t.button.innerHTML="",setTimeout(function(){t.button.innerHTML='\n "},100),t.option.mutex)for(var e=0;e'+t.getSVG("play")+" "},100),clearInterval(t.playedTime),t.trigger("pause"))}),this.audio.addEventListener("durationchange",function(){1!==t.audio.duration&&(t.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=t.secondToTime(t.audio.duration))}),this.audio.addEventListener("progress",function(){var e=t.audio.buffered.length?t.audio.buffered.end(t.audio.buffered.length-1)/t.audio.duration:0;t.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){t.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",t.trigger("pause")}),this.audio.addEventListener("canplay",function(){t.trigger("canplay")}),this.ended=!1,this.audio.addEventListener("ended",function(){t.multiple?0!==t.audio.currentTime&&("random"===t.mode?t.setMusic(t.nextRandomNum()):"single"===t.mode?t.setMusic(t.playIndex):"order"===t.mode?t.playIndex=200&&o.status<300||304===o.status?(i=o.responseText,t.lrcs[r]=n(i)):(console.log("Request was unsuccessful: "+o.status),t.lrcs[r]=[["00:00","Not available"]]),t.lrc=t.lrcs[r];var e="";t.lrcContents=t.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var a=0;a"+t.lrc[a][1]+"";t.lrcContents.innerHTML=e,t.lrcIndex||(t.lrcIndex=0),t.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),t.lrcContents.style.transform="translateY(0px)",t.lrcContents.style.webkitTransform="translateY(0px)"}};var s=void 0;s=this.option.music[r].lrc,o.open("get",s,!0),o.send(null)}i?this.lrcs[r]=n(i):3===this.option.showlrc?this.lrcs[r]=[["00:00","Loading"]]:this.lrcs[r]=[["00:00","Not available"]]}this.lrc=this.lrcs[r];var p="";this.lrcContents=this.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var c=0;c"+this.lrc[c][1]+"";this.lrcContents.innerHTML=p,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}},{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused&&this.audio.play()}},{key:"pause",value:function(){this.audio.paused||this.audio.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,t){"function"==typeof t&&this.event[e].push(t)}},{key:"toggle",value:function(){this.button.classList.contains("aplayer-play")?this.play():this.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"getRandomOrder",value:function(){function e(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}this.multiple&&(this.randomOrder=function(t){for(var a,n=t.length,r=new Array(n),i=0;i\n \n '+(this.option.music.length-e.length+r+1)+'\n '+e[r].title+'\n '+e[r].author+"\n ";a.innerHTML+=n,this.multiple||(this.multiple=!0,this.element.classList.add("aplayer-withlist"),this.audio.loop=!1),t.style.height="auto",t.style.height=t.offsetHeight+"px",this.getRandomOrder()}}]),e}();e.exports=o},function(e,t,a){t=e.exports=a(3)(void 0),t.push([e.i,".aplayer-narrow {\n width: 66px; }\n .aplayer-narrow .aplayer-info {\n display: none; }\n\n.aplayer-withlrc.aplayer-narrow {\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-pic {\n height: 90px;\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n margin-left: 90px;\n height: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-lrc {\n display: block; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n padding: 10px 7px 0 7px; }\n\n.aplayer-withlist.aplayer .aplayer-info {\n border-bottom: 1px solid #e9e9e9; }\n\n.aplayer-withlist.aplayer .aplayer-list {\n display: block; }\n\n.aplayer-withlist.aplayer .aplayer-icon-menu {\n display: inline !important; }\n\n.aplayer {\n font-family: Arial, Helvetica, sans-serif;\n margin: 5px;\n -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n border-radius: 2px;\n overflow: hidden;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n line-height: initial; }\n .aplayer * {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n .aplayer .aplayer-icon {\n width: 15px;\n height: 15px;\n border: none;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n opacity: .8;\n vertical-align: middle;\n padding: 0;\n font-size: 12px;\n margin: 0;\n display: inline; }\n .aplayer .aplayer-icon .aplayer-fill {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out; }\n .aplayer .aplayer-lrc-content {\n display: none; }\n .aplayer .aplayer-pic {\n position: relative;\n float: left;\n height: 66px;\n width: 66px;\n background-image: url("+a(6)+");\n background-size: 100%;\n -webkit-transition: all 0.3s ease;\n transition: all 0.3s ease; }\n .aplayer .aplayer-pic .aplayer-button {\n position: absolute;\n border-radius: 50%;\n opacity: 0.8;\n cursor: pointer;\n text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n background: rgba(0, 0, 0, 0.2);\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-pic .aplayer-button:hover {\n opacity: 1; }\n .aplayer .aplayer-pic .aplayer-button .aplayer-fill {\n fill: #fff; }\n .aplayer .aplayer-pic .aplayer-hide {\n display: none; }\n .aplayer .aplayer-pic .aplayer-play {\n width: 26px;\n height: 26px;\n border: 2px solid #fff;\n bottom: 50%;\n right: 50%;\n margin: 0 -15px -15px 0; }\n .aplayer .aplayer-pic .aplayer-play .aplayer-icon-play {\n position: absolute;\n top: 3px;\n left: 4px;\n height: 20px;\n width: 20px; }\n .aplayer .aplayer-pic .aplayer-pause {\n width: 16px;\n height: 16px;\n border: 2px solid #fff;\n bottom: 4px;\n right: 4px; }\n .aplayer .aplayer-pic .aplayer-pause .aplayer-icon-pause {\n position: absolute;\n top: 2px;\n left: 2px;\n height: 12px;\n width: 12px; }\n .aplayer .aplayer-info {\n margin-left: 66px;\n padding: 14px 7px 0 10px;\n height: 66px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n .aplayer .aplayer-info .aplayer-music {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0 0 13px 5px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default;\n padding-bottom: 2px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-title {\n font-size: 14px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-author {\n font-size: 12px;\n color: #666; }\n .aplayer .aplayer-info .aplayer-controller {\n position: relative;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {\n margin: 0 0 0 5px;\n padding: 4px 0;\n cursor: pointer !important;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {\n position: relative;\n height: 2px;\n width: 100%;\n background: #cdcdcd; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: #aaa;\n height: 2px;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 2px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 8px;\n width: 8px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time {\n position: relative;\n right: 0;\n bottom: 3px;\n height: 17px;\n color: #999;\n font-size: 11px;\n padding-left: 7px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {\n vertical-align: middle; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill {\n fill: #666; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-mode {\n margin-right: 4px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill {\n fill: #000; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-mode {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap {\n position: relative;\n display: inline-block;\n margin-left: 3px;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-volume-bar-wrap {\n display: block; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap {\n display: none;\n position: absolute;\n bottom: 15px;\n right: -3px;\n width: 25px;\n height: 40px;\n z-index: 99; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar {\n position: absolute;\n bottom: 0;\n right: 10px;\n width: 5px;\n height: 35px;\n background: #aaa; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 5px;\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-lrc {\n display: none;\n position: relative;\n height: 30px;\n text-align: center;\n overflow: hidden;\n margin: -10px 0 7px; }\n .aplayer .aplayer-lrc:before {\n position: absolute;\n top: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 10%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(white), to(rgba(255, 255, 255, 0)));\n background: linear-gradient(to bottom, white 0%, rgba(255, 255, 255, 0) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc:after {\n position: absolute;\n bottom: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 33%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc p {\n font-size: 12px;\n color: #666;\n line-height: 16px !important;\n height: 16px !important;\n padding: 0 !important;\n margin: 0 !important;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n opacity: 0.4;\n overflow: hidden; }\n .aplayer .aplayer-lrc p.aplayer-lrc-current {\n opacity: 1;\n overflow: visible;\n height: initial !important; }\n .aplayer .aplayer-lrc .aplayer-lrc-contents {\n width: 100%;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default; }\n .aplayer .aplayer-list {\n overflow: auto;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease;\n will-change: height;\n display: none; }\n .aplayer .aplayer-list.aplayer-list-hide {\n height: 0 !important; }\n .aplayer .aplayer-list::-webkit-scrollbar {\n width: 5px; }\n .aplayer .aplayer-list::-webkit-scrollbar-track {\n background-color: #f9f9f9; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background-color: #eee; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb:hover {\n background-color: #ccc; }\n .aplayer .aplayer-list ol {\n list-style-type: none;\n margin: 0;\n padding: 0; }\n .aplayer .aplayer-list ol li {\n position: relative;\n height: 32px;\n line-height: 32px;\n padding: 0 15px;\n font-size: 12px;\n border-top: 1px solid #e9e9e9;\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n overflow: hidden; }\n .aplayer .aplayer-list ol li:first-child {\n border-top: none; }\n .aplayer .aplayer-list ol li:hover {\n background: #efefef; }\n .aplayer .aplayer-list ol li.aplayer-list-light {\n background: #e9e9e9; }\n .aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-cur {\n display: inline-block; }\n .aplayer .aplayer-list ol li .aplayer-list-cur {\n display: none;\n width: 3px;\n height: 22px;\n position: absolute;\n left: 0;\n top: 5px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-index {\n color: #666;\n margin-right: 12px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-author {\n color: #666;\n float: right;\n cursor: pointer; }\n\n@-webkit-keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n\n@keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n",""])},function(e,t){function a(e,t){var a=e[1]||"",r=e[3];if(!r)return a;if(t&&"function"==typeof btoa){var i=n(r);return[a].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[a].join("\n")}function n(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=a(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,a){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r=0&&b.splice(t,1)}function o(e){var t=document.createElement("style");return e.attrs.type="text/css",p(t,e.attrs),i(e,t),t}function s(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",p(t,e.attrs),i(e,t),t}function p(e,t){Object.keys(t).forEach(function(a){e.setAttribute(a,t[a])})}function c(e,t){var a,n,r,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var p=g++;a=v||(v=o(t)),n=u.bind(null,a,p,!1),r=u.bind(null,a,p,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(a=s(t),n=y.bind(null,a,t),r=function(){l(a),a.href&&URL.revokeObjectURL(a.href)}):(a=o(t),n=d.bind(null,a),r=function(){l(a)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}function u(e,t,a,n){var r=a?"":n.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var i=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(i,l[t]):e.appendChild(i)}}function d(e,t){var a=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}function y(e,t,a){var n=a.css,r=a.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(n=x(n)),r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var l=new Blob([n],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(l),o&&URL.revokeObjectURL(o)}var h={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),f=function(e){var t={};return function(a){return void 0===t[a]&&(t[a]=e.call(this,a)),t[a]}}(function(e){return document.querySelector(e)}),v=null,g=0,b=[],x=a(5);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=m()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var a=r(e,t);return n(a,t),function(e){for(var i=[],l=0;l\n \n \n \n '},this.isMobile=/mobile/i.test(window.navigator.userAgent),this.isMobile&&(t.autoplay=!1);var s={element:document.getElementsByClassName("aplayer")[0],narrow:!1,autoplay:!1,mutex:!0,showlrc:0,theme:"#b7daff",mode:"circulation"};for(var p in s)s.hasOwnProperty(p)&&!t.hasOwnProperty(p)&&(t[p]=s[p]);if(this.option=t,this.audios=[],this.mode=t.mode,this.secondToTime=function(e){if(isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},a=parseInt(e/60),n=parseInt(e-60*a),r=parseInt(a/60),i=parseInt(e/60-60*parseInt(e/60/60));return e>=3600?t(r)+":"+t(i)+":"+t(n):t(a)+":"+t(n)},this.element=this.option.element,2===this.option.showlrc||!0===this.option.showlrc){this.savelrc=[];for(var c=0;c0?t:0,t=t<1?t:1,m[e+"Bar"].style[a]=100*t+"%"},this.updateLrc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.audio.currentTime;if(i.lrcIndex>i.lrc.length-1||e=i.lrc[i.lrcIndex+1][0])for(var t=0;t=i.lrc[t][0]&&(!i.lrc[t+1]||e1&&this.element.classList.add("aplayer-withlist"),this.multiple||"circulation"===this.mode||"order"===this.mode||(this.mode="circulation"),this.getRandomOrder();for(var y='\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 \n
\n
\n
\n \n
",h=0;h\n \n '+(h+1)+'\n '+this.option.music[h].title+'\n '+this.option.music[h].author+"\n ";y+="\n
\n
",this.element.innerHTML=y,this.element.offsetWidth<300&&(this.element.getElementsByClassName("aplayer-icon-mode")[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 m={};m.barWrap=this.element.getElementsByClassName("aplayer-bar-wrap")[0],this.option.narrow&&this.element.classList.add("aplayer-narrow"),this.button=this.element.getElementsByClassName("aplayer-button")[0],this.button.addEventListener("click",function(e){i.toggle()});var f=this.element.getElementsByClassName("aplayer-list")[0];f.addEventListener("click",function(e){var t=void 0;t="LI"===e.target.tagName.toUpperCase()?e.target:e.target.parentElement;var a=parseInt(t.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;a!==i.playIndex?(i.setMusic(a),i.play()):i.toggle()}),m.playedBar=this.element.getElementsByClassName("aplayer-played")[0],m.loadedBar=this.element.getElementsByClassName("aplayer-loaded")[0];var v=this.element.getElementsByClassName("aplayer-thumb")[0],g=void 0;m.barWrap.addEventListener("click",function(e){var t=e||window.event;g=m.barWrap.clientWidth;var n=(t.clientX-a(m.barWrap))/g;isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.updateBar("played",n,"width"),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration),i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration)}),v.addEventListener("mouseover",function(){v.style.background=i.option.theme}),v.addEventListener("mouseout",function(){v.style.background="#fff"});var b=function(e){var t=e||window.event,n=(t.clientX-a(m.barWrap))/g;n=n>0?n:0,n=n<1?n:1,i.updateBar("played",n,"width"),i.option.showlrc&&i.updateLrc(parseFloat(m.playedBar.style.width)/100*i.audio.duration),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(n*i.audio.duration)},x=function e(){document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",b),isNaN(i.audio.duration)?i.updateBar("played",0,"width"):(i.audio.currentTime=parseFloat(m.playedBar.style.width)/100*i.audio.duration,i.playedTime=setInterval(function(){i.updateBar("played",i.audio.currentTime/i.audio.duration,"width"),i.option.showlrc&&i.updateLrc(),i.element.getElementsByClassName("aplayer-ptime")[0].innerHTML=i.secondToTime(i.audio.currentTime),i.trigger("playing")},100))};v.addEventListener("mousedown",function(){g=m.barWrap.clientWidth,clearInterval(i.playedTime),document.addEventListener("mousemove",b),document.addEventListener("mouseup",x)}),m.volumeBar=this.element.getElementsByClassName("aplayer-volume")[0];var w=this.element.getElementsByClassName("aplayer-volume-bar")[0];this.volumeicon=this.element.getElementsByClassName("aplayer-time")[0].getElementsByTagName("button")[0];this.element.getElementsByClassName("aplayer-volume-bar-wrap")[0].addEventListener("click",function(e){var t=e||window.event,a=(35-t.clientY+n(w))/35;a=a>0?a:0,a=a<1?a:1,i.volume(a)}),this.volumeicon.addEventListener("click",function(){i.audio.muted?(i.audio.muted=!1,i.volumeicon.className=1===i.audio.volume?"aplayer-icon aplayer-icon-volume-up":"aplayer-icon aplayer-icon-volume-down",1===i.audio.volume?(i.volumeicon.className="aplayer-icon aplayer-icon-volume-up",i.volumeicon.innerHTML=i.getSVG("volume-up")):(i.volumeicon.className="aplayer-icon aplayer-icon-volume-down",i.volumeicon.innerHTML=i.getSVG("volume-down")),i.updateBar("volume",i.audio.volume,"height")):(i.audio.muted=!0,i.volumeicon.className="aplayer-icon aplayer-icon-volume-off",i.volumeicon.innerHTML=i.getSVG("volume-off"),i.updateBar("volume",0,"height"))});var A=this.element.getElementsByClassName("aplayer-icon-mode")[0];A.addEventListener("click",function(){i.multiple?"random"===i.mode?i.mode="single":"single"===i.mode?i.mode="order":"order"===i.mode?i.mode="circulation":"circulation"===i.mode&&(i.mode="random"):"circulation"===i.mode?i.mode="order":i.mode="circulation",A.innerHTML=i.getSVG(i.mode),i.audio.loop=!(i.multiple||"order"===i.mode)}),f.style.height=f.offsetHeight+"px",this.element.getElementsByClassName("aplayer-icon-menu")[0].addEventListener("click",function(){f.classList.contains("aplayer-list-hide")?f.classList.remove("aplayer-list-hide"):f.classList.add("aplayer-list-hide")}),"random"===this.mode?this.setMusic(this.randomOrder[0]):this.setMusic(0),l.push(this)}return i(e,[{key:"setMusic",value:function(e){var t=this;void 0!==e&&(this.playIndex=e);var a=this.playIndex;this.music=this.option.music[a],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.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")[a].classList.add("aplayer-list-light"),!this.isMobile&&this.audio&&(this.pause(),this.audio.currentTime=0),this.element.getElementsByClassName("aplayer-list")[0].scrollTop=33*a,this.isMobile&&this.audio?(this.audio.src=this.music.url,this.play()):!this.isMobile&&this.audios[a]?(this.audio=this.audios[a],this.audio.volume=parseInt(this.element.getElementsByClassName("aplayer-volume")[0].style.height)/100,this.audio.currentTime=0):(this.audio=document.createElement("audio"),this.audio.src=this.music.url,this.audio.preload=this.option.preload?this.option.preload:"auto",this.audio.addEventListener("play",function(){if(t.button.classList.contains("aplayer-play")){if(t.button.classList.remove("aplayer-play"),t.button.classList.add("aplayer-pause"),t.button.innerHTML="",setTimeout(function(){t.button.innerHTML='\n "},100),t.option.mutex)for(var e=0;e'+t.getSVG("play")+" "},100),clearInterval(t.playedTime),t.trigger("pause"))}),this.audio.addEventListener("durationchange",function(){1!==t.audio.duration&&(t.element.getElementsByClassName("aplayer-dtime")[0].innerHTML=t.secondToTime(t.audio.duration))}),this.audio.addEventListener("progress",function(){var e=t.audio.buffered.length?t.audio.buffered.end(t.audio.buffered.length-1)/t.audio.duration:0;t.updateBar("loaded",e,"width")}),this.audio.addEventListener("error",function(){t.element.getElementsByClassName("aplayer-author")[0].innerHTML=" - Error happens ╥﹏╥",t.trigger("pause")}),this.audio.addEventListener("canplay",function(){t.trigger("canplay")}),this.ended=!1,this.audio.addEventListener("ended",function(){t.multiple?0!==t.audio.currentTime&&("random"===t.mode?t.setMusic(t.nextRandomNum()):"single"===t.mode?t.setMusic(t.playIndex):"order"===t.mode?t.playIndex=200&&o.status<300||304===o.status?(i=o.responseText,t.lrcs[r]=n(i)):(console.log("Request was unsuccessful: "+o.status),t.lrcs[r]=[["00:00","Not available"]]),t.lrc=t.lrcs[r];var e="";t.lrcContents=t.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var a=0;a"+t.lrc[a][1]+"";t.lrcContents.innerHTML=e,t.lrcIndex||(t.lrcIndex=0),t.lrcContents.getElementsByTagName("p")[0].classList.add("aplayer-lrc-current"),t.lrcContents.style.transform="translateY(0px)",t.lrcContents.style.webkitTransform="translateY(0px)"}};var s=void 0;s=this.option.music[r].lrc,o.open("get",s,!0),o.send(null)}i?this.lrcs[r]=n(i):3===this.option.showlrc?this.lrcs[r]=[["00:00","Loading"]]:this.lrcs[r]=[["00:00","Not available"]]}this.lrc=this.lrcs[r];var p="";this.lrcContents=this.element.getElementsByClassName("aplayer-lrc-contents")[0];for(var c=0;c"+this.lrc[c][1]+"";this.lrcContents.innerHTML=p,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}},{key:"play",value:function(e){"[object Number]"===Object.prototype.toString.call(e)&&(this.audio.currentTime=e),this.audio.paused&&this.audio.play()}},{key:"pause",value:function(){this.audio.paused||this.audio.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,t){"function"==typeof t&&this.event[e].push(t)}},{key:"toggle",value:function(){this.button.classList.contains("aplayer-play")?this.play():this.button.classList.contains("aplayer-pause")&&this.pause()}},{key:"getRandomOrder",value:function(){function e(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}this.multiple&&(this.randomOrder=function(t){for(var a,n=t.length,r=new Array(n),i=0;i\n \n '+(this.option.music.length-e.length+r+1)+'\n '+e[r].title+'\n '+e[r].author+"\n ";a.innerHTML+=n,this.multiple||(this.multiple=!0,this.element.classList.add("aplayer-withlist"),this.audio.loop=!1),t.style.height="auto",t.style.height=t.offsetHeight+"px",this.getRandomOrder()}}]),e}();e.exports=o},function(e,t,a){t=e.exports=a(3)(void 0),t.push([e.i,".aplayer-narrow {\n width: 66px; }\n .aplayer-narrow .aplayer-info {\n display: none; }\n\n.aplayer-withlrc.aplayer-narrow {\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-pic {\n height: 90px;\n width: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n margin-left: 90px;\n height: 90px; }\n\n.aplayer-withlrc.aplayer .aplayer-lrc {\n display: block; }\n\n.aplayer-withlrc.aplayer .aplayer-info {\n padding: 10px 7px 0 7px; }\n\n.aplayer-withlist.aplayer .aplayer-info {\n border-bottom: 1px solid #e9e9e9; }\n\n.aplayer-withlist.aplayer .aplayer-list {\n display: block; }\n\n.aplayer-withlist.aplayer .aplayer-icon-menu {\n display: inline !important; }\n\n.aplayer {\n font-family: Arial, Helvetica, sans-serif;\n margin: 5px;\n -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);\n border-radius: 2px;\n overflow: hidden;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n line-height: initial; }\n .aplayer * {\n -webkit-box-sizing: content-box;\n box-sizing: content-box; }\n .aplayer .aplayer-icon {\n width: 15px;\n height: 15px;\n border: none;\n background-color: transparent;\n outline: none;\n cursor: pointer;\n opacity: .8;\n vertical-align: middle;\n padding: 0;\n font-size: 12px;\n margin: 0;\n display: inline; }\n .aplayer .aplayer-icon .aplayer-fill {\n -webkit-transition: all .2s ease-in-out;\n transition: all .2s ease-in-out; }\n .aplayer .aplayer-lrc-content {\n display: none; }\n .aplayer .aplayer-pic {\n position: relative;\n float: left;\n height: 66px;\n width: 66px;\n background-image: url("+a(6)+");\n background-size: 100%;\n -webkit-transition: all 0.3s ease;\n transition: all 0.3s ease; }\n .aplayer .aplayer-pic .aplayer-button {\n position: absolute;\n border-radius: 50%;\n opacity: 0.8;\n cursor: pointer;\n text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);\n background: rgba(0, 0, 0, 0.2);\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-pic .aplayer-button:hover {\n opacity: 1; }\n .aplayer .aplayer-pic .aplayer-button .aplayer-fill {\n fill: #fff; }\n .aplayer .aplayer-pic .aplayer-hide {\n display: none; }\n .aplayer .aplayer-pic .aplayer-play {\n width: 26px;\n height: 26px;\n border: 2px solid #fff;\n bottom: 50%;\n right: 50%;\n margin: 0 -15px -15px 0; }\n .aplayer .aplayer-pic .aplayer-play .aplayer-icon-play {\n position: absolute;\n top: 3px;\n left: 4px;\n height: 20px;\n width: 20px; }\n .aplayer .aplayer-pic .aplayer-pause {\n width: 16px;\n height: 16px;\n border: 2px solid #fff;\n bottom: 4px;\n right: 4px; }\n .aplayer .aplayer-pic .aplayer-pause .aplayer-icon-pause {\n position: absolute;\n top: 2px;\n left: 2px;\n height: 12px;\n width: 12px; }\n .aplayer .aplayer-info {\n margin-left: 66px;\n padding: 14px 7px 0 10px;\n height: 66px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box; }\n .aplayer .aplayer-info .aplayer-music {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0 0 13px 5px;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default;\n padding-bottom: 2px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-title {\n font-size: 14px; }\n .aplayer .aplayer-info .aplayer-music .aplayer-author {\n font-size: 12px;\n color: #666; }\n .aplayer .aplayer-info .aplayer-controller {\n position: relative;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {\n margin: 0 0 0 5px;\n padding: 4px 0;\n cursor: pointer !important;\n -webkit-box-flex: 1;\n -ms-flex: 1;\n flex: 1; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {\n position: relative;\n height: 2px;\n width: 100%;\n background: #cdcdcd; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n background: #aaa;\n height: 2px;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {\n position: absolute;\n left: 0;\n top: 0;\n bottom: 0;\n height: 2px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played .aplayer-thumb {\n position: absolute;\n top: 0;\n right: 5px;\n margin-top: -4px;\n margin-right: -10px;\n height: 8px;\n width: 8px;\n border-radius: 50%;\n background: #fff;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time {\n position: relative;\n right: 0;\n bottom: 3px;\n height: 17px;\n color: #999;\n font-size: 11px;\n padding-left: 7px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-time-inner {\n vertical-align: middle; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon .aplayer-fill {\n fill: #666; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-mode {\n margin-right: 4px; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover .aplayer-fill {\n fill: #000; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon.aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-mode {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-time.aplayer-time-narrow .aplayer-icon-menu {\n display: none; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap {\n position: relative;\n display: inline-block;\n margin-left: 3px;\n cursor: pointer !important; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap:hover .aplayer-volume-bar-wrap {\n display: block; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap {\n display: none;\n position: absolute;\n bottom: 15px;\n right: -3px;\n width: 25px;\n height: 40px;\n z-index: 99; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar {\n position: absolute;\n bottom: 0;\n right: 10px;\n width: 5px;\n height: 35px;\n background: #aaa; }\n .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume {\n position: absolute;\n bottom: 0;\n right: 0;\n width: 5px;\n -webkit-transition: all 0.1s ease;\n transition: all 0.1s ease; }\n .aplayer .aplayer-lrc {\n display: none;\n position: relative;\n height: 30px;\n text-align: center;\n overflow: hidden;\n margin: -10px 0 7px; }\n .aplayer .aplayer-lrc:before {\n position: absolute;\n top: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 10%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(white), to(rgba(255, 255, 255, 0)));\n background: linear-gradient(to bottom, white 0%, rgba(255, 255, 255, 0) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc:after {\n position: absolute;\n bottom: 0;\n z-index: 1;\n display: block;\n overflow: hidden;\n width: 100%;\n height: 33%;\n content: ' ';\n background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0.8)));\n background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 100%);\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ccffffff',GradientType=0 ); }\n .aplayer .aplayer-lrc p {\n font-size: 12px;\n color: #666;\n line-height: 16px !important;\n height: 16px !important;\n padding: 0 !important;\n margin: 0 !important;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n opacity: 0.4;\n overflow: hidden; }\n .aplayer .aplayer-lrc p.aplayer-lrc-current {\n opacity: 1;\n overflow: visible;\n height: initial !important; }\n .aplayer .aplayer-lrc .aplayer-lrc-contents {\n width: 100%;\n -webkit-transition: all 0.5s ease-out;\n transition: all 0.5s ease-out;\n -webkit-user-select: text;\n -moz-user-select: text;\n -ms-user-select: text;\n user-select: text;\n cursor: default; }\n .aplayer .aplayer-list {\n overflow: auto;\n -webkit-transition: all 0.5s ease;\n transition: all 0.5s ease;\n will-change: height;\n display: none; }\n .aplayer .aplayer-list.aplayer-list-hide {\n height: 0 !important; }\n .aplayer .aplayer-list::-webkit-scrollbar {\n width: 5px; }\n .aplayer .aplayer-list::-webkit-scrollbar-track {\n background-color: #f9f9f9; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background-color: #eee; }\n .aplayer .aplayer-list::-webkit-scrollbar-thumb:hover {\n background-color: #ccc; }\n .aplayer .aplayer-list ol {\n list-style-type: none;\n margin: 0;\n padding: 0; }\n .aplayer .aplayer-list ol li {\n position: relative;\n height: 32px;\n line-height: 32px;\n padding: 0 15px;\n font-size: 12px;\n border-top: 1px solid #e9e9e9;\n cursor: pointer;\n -webkit-transition: all 0.2s ease;\n transition: all 0.2s ease;\n overflow: hidden; }\n .aplayer .aplayer-list ol li:first-child {\n border-top: none; }\n .aplayer .aplayer-list ol li:hover {\n background: #efefef; }\n .aplayer .aplayer-list ol li.aplayer-list-light {\n background: #e9e9e9; }\n .aplayer .aplayer-list ol li.aplayer-list-light .aplayer-list-cur {\n display: inline-block; }\n .aplayer .aplayer-list ol li .aplayer-list-cur {\n display: none;\n width: 3px;\n height: 22px;\n position: absolute;\n left: 0;\n top: 5px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-index {\n color: #666;\n margin-right: 12px;\n cursor: pointer; }\n .aplayer .aplayer-list ol li .aplayer-list-author {\n color: #666;\n float: right;\n cursor: pointer; }\n\n@-webkit-keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n\n@keyframes aplayer-roll {\n 0% {\n left: 0; }\n 100% {\n left: -100%; } }\n",""])},function(e,t){function a(e,t){var a=e[1]||"",r=e[3];if(!r)return a;if(t&&"function"==typeof btoa){var i=n(r);return[a].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[a].join("\n")}function n(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=a(t,e);return t[2]?"@media "+t[2]+"{"+n+"}":n}).join("")},t.i=function(e,a){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r=0&&b.splice(t,1)}function o(e){var t=document.createElement("style");return e.attrs.type="text/css",p(t,e.attrs),i(e,t),t}function s(e){var t=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",p(t,e.attrs),i(e,t),t}function p(e,t){Object.keys(t).forEach(function(a){e.setAttribute(a,t[a])})}function c(e,t){var a,n,r,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var p=g++;a=v||(v=o(t)),n=u.bind(null,a,p,!1),r=u.bind(null,a,p,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(a=s(t),n=y.bind(null,a,t),r=function(){l(a),a.href&&URL.revokeObjectURL(a.href)}):(a=o(t),n=d.bind(null,a),r=function(){l(a)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else r()}}function u(e,t,a,n){var r=a?"":n.css;if(e.styleSheet)e.styleSheet.cssText=w(t,r);else{var i=document.createTextNode(r),l=e.childNodes;l[t]&&e.removeChild(l[t]),l.length?e.insertBefore(i,l[t]):e.appendChild(i)}}function d(e,t){var a=t.css,n=t.media;if(n&&e.setAttribute("media",n),e.styleSheet)e.styleSheet.cssText=a;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(a))}}function y(e,t,a){var n=a.css,r=a.sourceMap,i=void 0===t.convertToAbsoluteUrls&&r;(t.convertToAbsoluteUrls||i)&&(n=x(n)),r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var l=new Blob([n],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(l),o&&URL.revokeObjectURL(o)}var h={},m=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),f=function(e){var t={};return function(a){return void 0===t[a]&&(t[a]=e.call(this,a)),t[a]}}(function(e){return document.querySelector(e)}),v=null,g=0,b=[],x=a(5);e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");t=t||{},t.attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||(t.singleton=m()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var a=r(e,t);return n(a,t),function(e){for(var i=[],l=0;l=200&&i.status<400){var t=JSON.parse(i.responseText);e(a,t)}},i.send()}else{var n=[];n.title=a.dataset.title,n.author=a.dataset.author,n.url=a.dataset.url,n.pic=a.dataset.pic,n.lrc=a.dataset.lrc,e(a,[n])}})});
+"use strict";console.log("\n %c MetingJS 1.0.1 %c https://github.com/metowolf/MetingJS \n\n","color: #fff; background-image: linear-gradient(90deg, rgb(47, 172, 178) 0%, rgb(45, 190, 96) 100%); padding:5px 1px;","background-image: linear-gradient(90deg, rgb(45, 190, 96) 0%, rgb(255, 255, 255) 100%); padding:5px 0;");var aplayers=[];document.addEventListener("DOMContentLoaded",function(){function a(a,b){var c=[],d=a.dataset;c.element=a,c.music=b,c.showlrc=c.music[0].lrc?3:0,c.narrow="true"===d.narrow,c.autoplay="true"===d.autoplay,c.mutex="false"!==d.mutex,c.mode=d.mode||"circulation",c.preload=d.preload||"auto",c.listmaxheight=d.listmaxheight||"340px",c.theme=d.theme||"#ad7a86",aplayers.push(new APlayer(c))}var b="https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r";"undefined"!=typeof meting_api&&(b=meting_api);var c=document.querySelectorAll(".aplayer"),d=!0,e=!1,f=void 0;try{for(var g,h=function(){var c=g.value,d=c.dataset.id;if(d){var e=b;e=e.replace(":server",c.dataset.server),e=e.replace(":type",c.dataset.type),e=e.replace(":id",c.dataset.id),e=e.replace(":r",Math.random());var f=new XMLHttpRequest;f.onreadystatechange=function(){if(4===f.readyState&&(200<=f.status&&300>f.status||304===f.status)){var b=JSON.parse(f.responseText);a(c,b)}},f.open("get",e,!0),f.send(null)}else{var h=[{title:c.dataset.title,author:c.dataset.author,url:c.dataset.url,pic:c.dataset.pic,lrc:c.dataset.lrc}];a(c,h)}},i=c[Symbol.iterator]();!(d=(g=i.next()).done);d=!0)h()}catch(a){e=!0,f=a}finally{try{!d&&i.return&&i.return()}finally{if(e)throw f}}},!1);
diff --git a/assets/editer.js b/assets/editer.js
index ae23acc..e9b28d7 100644
--- a/assets/editer.js
+++ b/assets/editer.js
@@ -7,7 +7,7 @@ $(function() {
''+
'
'+
'
插入音乐
'+
- '
请在下方的输入框内输入要插入的音乐地址,如多个地址请用回车隔开'+
+ '
请在下方的输入框内输入要插入的音乐地址'+
'
'+
'
'+
'