From af0200a4a58dbb8ee76ab2fe5590a8487e3e3443 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Mon, 18 Apr 2022 02:04:24 -0500 Subject: [PATCH] Removed unecessary constant variable. --- audioshowkit/src/player/PlaylistSong.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/audioshowkit/src/player/PlaylistSong.js b/audioshowkit/src/player/PlaylistSong.js index 4961a74..36da1d9 100644 --- a/audioshowkit/src/player/PlaylistSong.js +++ b/audioshowkit/src/player/PlaylistSong.js @@ -50,7 +50,7 @@ export default class PlayListSong { } this.#audio = new Audio(this.#url); console.log("Fetching from url: " + this.#url); - const listener = () => { + this.#audio.addEventListener("canplaythrough", () => { this.#ready = true; console.log("attempting to invoke onReady."); console.log(onReady); @@ -58,8 +58,7 @@ export default class PlayListSong { onReady(this.#audio); console.log("onReady invoked."); } - }; - this.#audio.addEventListener("canplaythrough", listener, { once: true }); + }, { once: true }); return this.#audio; }