fix switching music bug, close #83 #85

This commit is contained in:
DIYgod
2016-10-26 21:17:31 +08:00
parent 370d039099
commit 3877378602
4 changed files with 4 additions and 12 deletions
+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",
"version": "1.5.7",
"version": "1.5.8",
"description": "Wow, such a beautiful html5 music player",
"main": "dist/APlayer.min.js",
"scripts": {
+1 -9
View File
@@ -1,4 +1,4 @@
console.log("\n %c APlayer 1.5.7 %c http://aplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");
console.log("\n %c APlayer 1.5.8 %c http://aplayer.js.org \n\n","color: #fadfa3; background: #030307; padding:5px 0;","background: #fadfa3; padding:5px 0;");
require('./APlayer.scss');
@@ -465,14 +465,6 @@ class APlayer {
this.audio.src = this.music.url;
this.audio.preload = this.option.preload ? this.option.preload : 'auto';
this.audio.addEventListener('play', () => {
this.play();
});
this.audio.addEventListener('pause', () => {
this.pause();
});
// show audio time: the metadata has loaded or changed
this.audio.addEventListener('durationchange', () => {
if (this.audio.duration !== 1) { // compatibility: Android browsers will output 1 at first