7 Commits
Author SHA1 Message Date
DIYgod 47270238cb Fix bug: Symbol is not defined 2016-05-14 21:40:03 +08:00
DIYgod 04e950b1eb bugs with mutex 2016-05-14 20:04:41 +08:00
DIYgod 54f9d5dcf9 new demo link 2016-05-14 15:44:20 +08:00
DIYgod 2b6ba28167 rm CNAME 2016-05-14 15:13:35 +08:00
DIYgod 10ad8cd38d CNAME 2016-05-14 00:55:46 +08:00
DIYgod adb2cd4ed8 change demo link 2016-05-12 18:11:53 +08:00
DIYgod f1bc748330 optimize 2016-05-10 01:00:16 +08:00
6 changed files with 29 additions and 27 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ Wow, such a beautiful html5 music player
UI 参考网易云音乐外链播放器 UI 参考网易云音乐外链播放器
[Demo](http://diygod.github.io/APlayer/demo) [Demo](http://aplayer.js.org)
Screenshot Screenshot
![image](https://i.imgur.com/JDrJXCr.png) ![image](https://i.imgur.com/JDrJXCr.png)
+18 -18
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "aplayer", "name": "aplayer",
"version": "1.4.3", "version": "1.4.4",
"description": "Wow, such a beautiful html5 music player", "description": "Wow, such a beautiful html5 music player",
"main": "dist/APlayer.min.js", "main": "dist/APlayer.min.js",
"scripts": { "scripts": {
+7 -5
View File
@@ -127,12 +127,12 @@
// define APlayer events // define APlayer events
this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error']; this.eventTypes = ['play', 'pause', 'canplay', 'playing', 'ended', 'error'];
this.event = {}; this.event = {};
for (let type of this.eventTypes) { for (let i = 0; i < this.eventTypes.length; i++) {
this.event[type] = []; this.event[this.eventTypes[i]] = [];
} }
this.trigger = (type) => { this.trigger = (type) => {
for (let func of this.event[type]) { for (let i = 0; i < this.event[type].length; i++) {
func(); this.event[type][i]();
} }
} }
} }
@@ -230,6 +230,8 @@
} }
this.element.innerHTML = eleHTML; this.element.innerHTML = eleHTML;
this.ptime = this.element.getElementsByClassName('aplayer-ptime')[0];
if (this.element.getElementsByClassName('aplayer-info')[0].offsetWidth < 200) { if (this.element.getElementsByClassName('aplayer-info')[0].offsetWidth < 200) {
this.element.getElementsByClassName('aplayer-time')[0].classList.add('aplayer-time-narrow'); this.element.getElementsByClassName('aplayer-time')[0].classList.add('aplayer-time-narrow');
} }
@@ -579,7 +581,7 @@
if (this.option.showlrc) { if (this.option.showlrc) {
this.updateLrc(); this.updateLrc();
} }
this.element.getElementsByClassName('aplayer-ptime')[0].innerHTML = this.secondToTime(this.audio.currentTime); this.ptime.innerHTML = this.secondToTime(this.audio.currentTime);
this.trigger('playing'); this.trigger('playing');
}, 100); }, 100);
this.trigger('play'); this.trigger('play');