Actually set the music to the audio element

In the default state, each audio element should already have the music url set. However, if a user externally adjusts the music stored on the APlayer and attempts to switch to it, everything _but_ the audio would change. This allows users to modify the music set in the options manually.
This commit is contained in:
Eric Robinson 2017-12-12 13:42:54 -05:00
parent 17c80e4083
commit e7168ec462
1 changed files with 1 additions and 0 deletions

View File

@ -483,6 +483,7 @@ class APlayer {
this.audio = this.audios[indexMusic];
this.audio.volume = parseInt(this.element.getElementsByClassName('aplayer-volume')[0].style.height) / 100;
this.audio.currentTime = 0;
this.audio.src = this.music.url;
}
else {
this.audio = document.createElement("audio");