🍰 2.0.2,日常更新 APlayer, MetingJS

- MetingJS 1.4.0 暴露接口,方便 pjax 回调
 - APlayer 1.6.1 优化了部分 UI
This commit is contained in:
METO 2017-11-16 21:26:55 +08:00
parent a080c4ca93
commit a52dc90c8f
5 changed files with 26 additions and 12 deletions

View File

@ -142,7 +142,7 @@ class Meting_Action extends Typecho_Widget implements Widget_Interface_Do {
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('/#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');
}

View File

@ -6,13 +6,13 @@ if(!defined('__TYPECHO_ROOT_DIR__'))exit;
*
* @package APlayer for Typecho | Meting
* @author METO
* @version 2.0.1
* @version 2.0.2
* @dependence 14.10.10-*
* @link https://github.com/MoePlayer/APlayer-Typecho
*
*/
define('METING_VERSION','2.0.1');
define('METING_VERSION','2.0.2');
class Meting_Plugin extends Typecho_Widget implements Typecho_Plugin_Interface
{

View File

@ -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
@ -64,6 +64,19 @@ 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 版本重写了实现方式,旧的混合歌单将不再支持,建议通过各音乐平台创建歌单的方式添加。
更多问题可以通过 issue 页面提交,或者通过 Telegram、邮件向我反馈
## LICENSE

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! meting.aplayer.js v1.2.2 | MIT License */
function r(e){/in/.test(document.readyState)?setTimeout("r("+e+")",9):e()}r(function(){function e(e,t){var a=[],r=e.dataset;a.element=e,a.music=t,a.showlrc=a.music[0].lrc?3:0,a.narrow="true"===r.narrow,a.autoplay="true"===r.autoplay,a.mutex="false"!==r.mutex,a.mode=r.mode||"circulation",a.preload=r.preload||"auto",a.listmaxheight=r.listmaxheight||"340px",a.theme=r.theme||"#ad7a86",new APlayer(a)}console.log("\n %c Meting 1.2.2 %c https://i-meto.com/ghost-aplayer/ \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 t="https://api.i-meto.com/meting/api?server=:server&type=:type&id=:id&r=:r";"undefined"!=typeof meting_api&&(t=meting_api);var a=document.querySelectorAll(".aplayer");Array.prototype.forEach.call(a,function(a,r){if(a.dataset.id){var i=new XMLHttpRequest,o=t;o=(o=(o=(o=o.replace(":server",a.dataset.server)).replace(":type",a.dataset.type)).replace(":id",a.dataset.id)).replace(":r",Math.random()),i.open("GET",o,!0),i.onload=function(){if(i.status>=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])}})});
/*! Meting.js 1.4.0 | MIT License */
"use strict";console.log("\n %c Meting 1.4.0 %c https://i-meto.com/ghost-aplayer/ \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=[];(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}}})();