Vinyl
    Preparing search index...

    Interface SegmentProvider

    Provides an abstraction to resolving media segments. Readonly

    interface SegmentProvider {
        getDuration(): Promise<null | number>;
        getMinBufferTime(): Promise<number>;
        getSegment(
            time: number,
            prefetchState: PrefetchState,
        ): Promise<null | SegmentReference<SegmentDataProvider>>;
        hasAnyListeners(): boolean;
        hasListeners(type: "change"): boolean;
        on<K extends "change">(
            type: K,
            handler: EventHandler<SegmentProviderEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    • The duration of the media, in seconds. Returns null if duration cannot be determined.

      Returns Promise<null | number>

    • The minimum duration of the buffer that a client should maintain for uninterrupted playback.

      Returns Promise<number>

    • Gets the segment provider at the given time, or null if time is outside the time range.

      Parameters

      • time: number

        The time, in seconds, relative to the presentation timeline.

      • prefetchState: PrefetchState

        The current state of prefetching.

      Returns Promise<null | SegmentReference<SegmentDataProvider>>

    • Returns true if the event host has any listeners.

      Returns boolean

    • Returns true if the event host has any listeners for the given type.

      Parameters

      • type: "change"

      Returns boolean