From e7168ec4621e89eb321fee93c992bb568440ccf6 Mon Sep 17 00:00:00 2001 From: Eric Robinson Date: Tue, 12 Dec 2017 13:42:54 -0500 Subject: [PATCH] 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. --- src/APlayer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/APlayer.js b/src/APlayer.js index 6e93a89..47712ca 100644 --- a/src/APlayer.js +++ b/src/APlayer.js @@ -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");