Skip to content

Commit e7168ec

Browse files
committed
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.
1 parent 17c80e4 commit e7168ec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/APlayer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ class APlayer {
483483
this.audio = this.audios[indexMusic];
484484
this.audio.volume = parseInt(this.element.getElementsByClassName('aplayer-volume')[0].style.height) / 100;
485485
this.audio.currentTime = 0;
486+
this.audio.src = this.music.url;
486487
}
487488
else {
488489
this.audio = document.createElement("audio");

0 commit comments

Comments
 (0)