API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classAbstractMedia
Shared base for Sound and Music: holds playback primitives (volume, loop, playbackRate, muted, currentTime), the AudioBus routing slot, lifecycle Signals (`onStart`, `onStop`), and ramp helpers (AbstractMedia.fadeIn, AbstractMedia.fadeOut) that operate on whatever `GainNode` the subclass exposes. Subclasses implement the abstract members to bind to either an `AudioBufferSourceNode` (Sound) or `MediaElementAudioSourceNode` (Music).
import { AbstractMedia } from '@codexo/exojs' Shared base for Sound and Music: holds playback primitives (volume, loop, playbackRate, muted, currentTime), the AudioBus routing slot, lifecycle Signals (`onStart`, `onStop`), and ramp helpers (AbstractMedia.fadeIn, AbstractMedia.fadeOut) that operate on whatever `GainNode` the subclass exposes.
Subclasses implement the abstract members to bind to either an `AudioBufferSourceNode` (Sound) or `MediaElementAudioSourceNode` (Music).
new(initialState: AbstractMediaInitialState): AbstractMedia _connectToBus(): void _defaultBus(): AudioBus _disconnectFromBus(): void _getAudioSetup(): object | null applyOptions(options: Partial<PlaybackOptions>): this destroy(): void fadeIn(durationMs: number): this fadeOut(durationMs: number, options: object): this getTime(): number pause(options?: Partial<PlaybackOptions>): this play(options?: Partial<PlaybackOptions>): this setLoop(loop: boolean): this setMuted(muted: boolean): this setPlaybackRate(playbackRate: number): this setTime(time: number): this setVolume(volume: number): this stop(options?: Partial<PlaybackOptions>): this toggle(options?: Partial<PlaybackOptions>): this analyserTarget: AudioNode | null bus: AudioBus currentTime: number duration: number loop: boolean muted: boolean paused: boolean playbackRate: number playing: boolean progress: number volume: number onStart: Signal<[]> onStop: Signal<[]>