Skip to content

Commit

Permalink
fix: reconnect audio after disabling visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
flip-dots committed Jun 12, 2023
1 parent bc6ad54 commit 02d4bb7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/src/components/Playback/MusicVisualizer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ onBeforeUnmount(() => {
visualizer.toggleAnalyzer();
visualizer.disconnectInput();
visualizer.disconnectOutput();
if (mediaElementRef.value) {
const audioCtx = new AudioContext();
audioCtx
.createMediaElementSource(mediaElementRef.value)
.connect(audioCtx.destination);
}
}
});
</script>

0 comments on commit 02d4bb7

Please sign in to comment.