Vinyl
    Preparing search index...

    Interface ReadonlyStreamingState

    Represents the streaming-related state for a single track.

    Provides read-only access to:

    • The currently fetched media time ranges
    • The current streaming, buffering, and playback quality metadata

    To observe changes over time, listen to events defined in StreamingEventMap, including:

    • streamingQualityChange
    • bufferingQualityChange
    • playbackQualityChange
    interface ReadonlyStreamingState {
        contentTypes: Readonly<
            Omit<Set<ContentType>, "clear" | "delete" | "add">,
        >;
        fetchedRanges: ReadonlyRanges;
        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)

    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.

    Methods

    • The currently streaming media quality for the given content stream. This is set when a new quality is being requested.

      Quality metadata progresses as follows: streamingQuality -> bufferingQuality -> playbackQuality

      Listen to TrackEventMap.streamingQualityChange events for changes.

      Parameters

      Returns null | MediaQualityMetadata

    • Returns true if the event host has any listeners.

      Returns boolean