diff --git a/src/player/PlaylistSong.js b/src/player/PlaylistSong.js index 492099a..3c3c849 100644 --- a/src/player/PlaylistSong.js +++ b/src/player/PlaylistSong.js @@ -51,7 +51,7 @@ export default class PlayListSong { this._audio.addEventListener("canplaythrough", () => { this.ready = true; - if (onReady) { + if (onReady && this.isAudioInstantiated()) { onReady(this._audio); } }); diff --git a/src/player/SongPlayer.js b/src/player/SongPlayer.js index f7f1fd9..3418da7 100644 --- a/src/player/SongPlayer.js +++ b/src/player/SongPlayer.js @@ -105,7 +105,6 @@ export default class SongPlayer { playCurrent() { this.getCurrentSong().getAudio((audio) => { - // TODO: May need to perform synchronization check to see if this is still the song to be played. audio.volume = this._volume; audio.play(); }); @@ -232,8 +231,8 @@ export default class SongPlayer { /** * @callback changeListener - * @param {any} old the previous value. - * @param {any} current the the current (new) value. + * @param {*} old the previous value. + * @param {*} current the the current (new) value. */ /**