Skip to content

Commit 7b3b933

Browse files
committed
call disconnect for each sound when shutting down
1 parent c678bda commit 7b3b933

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/library/audio.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,16 +223,10 @@ export class PlayerAudio {
223223
songsQueue.forEach((sound) => {
224224
if (sound.sourceNode instanceof MediaElementAudioSourceNode) {
225225
if (typeof sound.sourceNode.mediaElement !== 'undefined') {
226-
// clone the element to remove all listeners
227-
// commented out remove listeners as media element is removed, so if there
228-
// is no reference to it, the listeners should get removed too
229-
//sound.sourceNode.mediaElement.replaceWith(sound.sourceNode.mediaElement.cloneNode(true));
230-
// call its own remove method
231226
sound.sourceNode.mediaElement.remove();
232227
}
233-
} else if (sound.sourceNode instanceof AudioBufferSourceNode) {
234-
//
235228
}
229+
sound.sourceNode.disconnect();
236230
});
237231

238232
this._disconnectPlayerGainNode();

0 commit comments

Comments
 (0)