Vinyl
    Preparing search index...

    Interface ReadonlyPlaybackStreamingState

    Represents the streaming state of the currently active track.

    This interface provides access to the current state of streaming, including:

    • Fetched data ranges and progress
    • Streaming quality transitions (streaming, buffering, playback)

    Consumers can use this interface to monitor streaming progress and quality changes during playback. All properties are read-only and reflect the current state.

    To react to changes over time, listen to events defined in TrackEventMap, such as:

    • streamingQualityChange
    • bufferingQualityChange
    • playbackQualityChange
    interface ReadonlyPlaybackStreamingState {
        contentTypes: Readonly<
            Omit<Set<ContentType>, "clear" | "delete" | "add">,
        >;
        fetchedRanges: ReadonlyRanges;
        fetchedTime: number;
        fetchedTimePercent: number;
        getBufferingQuality(contentType: ContentType): null | MediaQualityMetadata;
        getPlaybackQuality(contentType: ContentType): null | MediaQualityMetadata;
        getStreamingQuality(contentType: ContentType): null | MediaQualityMetadata;
        hasAnyListeners(): boolean;
        hasListeners(type: keyof StreamingEventMap): boolean;
        on<K extends keyof StreamingEventMap>(
            type: K,
            handler: EventHandler<StreamingEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    contentTypes: Readonly<Omit<Set<ContentType>, "clear" | "delete" | "add">>

    The current content types for the active streams, e.g. Set(['audio', 'video'])

    fetchedRanges: ReadonlyRanges

    The time ranges the track has fetched. This will be a snapshot of the fetched ranges at the time this property is accessed.

    fetchedTime: number

    Returns the time of the prefetch end. If no data has been prefetched for the current track, 0 will be returned.

    The time given will be in seconds according to the media timeline. It will represent the ending time of the continuous prefetch range from the current playhead time.

    fetchedTimePercent: number

    Returns current fetched time as a percent of the total duration.

    A number between 0-1

    Methods

    • Returns true if the event host has any listeners.

      Returns boolean