refactor(visualizer): Removed restart requirement and refactored impls (#4200)

This commit is contained in:
Iris
2026-01-29 09:24:00 +01:00
committed by GitHub
parent 2180a2a810
commit 442dd51d3d
5 changed files with 138 additions and 147 deletions

View File

@ -1,22 +1,15 @@
import type { VisualizerPluginConfig } from '../index';
export abstract class Visualizer<T> {
/**
* The name must be the same as the file name.
*/
abstract name: string;
abstract visualizer: T;
export abstract class Visualizer {
protected audioNode: GainNode;
protected audioSource: MediaElementAudioSourceNode;
protected constructor(
_audioContext: AudioContext,
_audioSource: MediaElementAudioSourceNode,
_visualizerContainer: HTMLElement,
_canvas: HTMLCanvasElement,
_audioNode: GainNode,
_stream: MediaStream,
_options: VisualizerPluginConfig,
) {}
) {
this.audioNode = _audioNode;
this.audioSource = _audioSource;
}
abstract resize(width: number, height: number): void;
abstract render(): void;
abstract destroy(): void;
}