mobile compatibility of playlist

This commit is contained in:
DIYgod 2016-01-15 15:09:40 +08:00
parent 8296b884d3
commit 0a77bbca3b
3 changed files with 5 additions and 2 deletions

2
dist/APlayer.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "aplayer",
"version": "1.3.1",
"version": "1.3.2",
"description": "Wow, such a beautiful html5 music player",
"main": "APlayer.js",
"scripts": {

View File

@ -137,6 +137,7 @@ APlayer.prototype.init = function () {
if (musicIndex !== _self.playIndex) {
_self.setMusic(musicIndex);
}
_self.play();
});
}
}
@ -311,6 +312,7 @@ APlayer.prototype.setMusic = function (index) {
this.audio = document.createElement("audio");
this.audio.src = this.music.url;
this.audio.preload = this.isMobile ? 'none' : 'metadata';
this.audio.currentTime = 0;
// show audio time
var _self = this;
@ -359,6 +361,7 @@ APlayer.prototype.setMusic = function (index) {
else {
this.audio = this.audios[indexMusic];
this.audio.volume = parseInt(this.element.getElementsByClassName('aplayer-volume')[0].style.height) / 100;
this.audio.currentTime = 0;
}
// fill in lrc