Vinyl
    Preparing search index...

    Interface ReadonlyTrackController<TrackLoadOptionsType>

    A readonly interface to the track controller.

    interface ReadonlyTrackController<TrackLoadOptionsType extends TrackLoadOptions> {
        currentTrack: null | ReadonlyTrack;
        queue: readonly TrackLoadOptionsType[];
        getCachedTrack(uri: string): null | ReadonlyTrack;
        getCachedTracks(): IterableIterator<ReadonlyTrack>;
        hasAnyListeners(): boolean;
        hasListeners(
            type: keyof TrackControllerEventMap<TrackLoadOptionsType>,
        ): boolean;
        hasNext(): boolean;
        isTrackCached(uri: string): boolean;
        on<K extends keyof TrackControllerEventMap<TrackLoadOptionsType>>(
            type: K,
            handler: EventHandler<TrackControllerEventMap<TrackLoadOptionsType>[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    currentTrack: null | ReadonlyTrack

    Returns the current track.

    queue: readonly TrackLoadOptionsType[]

    Returns the current queue of TrackLoadOptions. Observe 'queueChange' for changes to this queue.

    Methods

    • Returns the cached track for the given URI, or null if the track is not cached.

      Parameters

      • uri: string

      Returns null | ReadonlyTrack

    • Returns an iterator of currently cached tracks.

      Returns IterableIterator<ReadonlyTrack>

    • Returns true if the event host has any listeners.

      Returns boolean

    • Returns true if there is at least one track in the queue.

      Returns boolean

    • Returns true if the track with the given URI is cached.

      Parameters

      • uri: string

      Returns boolean