Vinyl
    Preparing search index...

    Interface Track<LoadOptionsType>

    One track is active on the track controller at a time.

    interface Track<LoadOptionsType extends AnyRecord = AnyRecord> {
        active: boolean;
        contentTypes: Readonly<Omit<Set<ContentType>, "clear" | "delete" | "add">>;
        disposed: boolean;
        error: null | Error;
        extra: any;
        fetchedRanges: ReadonlyRanges;
        logPrefix: string;
        type: string;
        uri: string;
        activate(loadOptions: LoadOptionsType): void;
        clearPrefetch(): void;
        deactivate(): void;
        dispose(): void;
        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;
        preload(
            trackOptions: TrackPreloadOptions,
            loadOptions: LoadOptionsType,
        ): void;
        reset(): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    active: boolean

    True if the track is the currently playing track.

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

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

    disposed: boolean

    True if the track has been disposed.

    error: null | Error

    The last error that occurred in this track, or null if no error.

    extra: any

    Returns the extra object from the load configuration's config when this track is active, or null if this track is not active.

    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.

    logPrefix: string

    A string prefix for all log statements made by this target.

    type: string

    The type of track.

    uri: string

    The track identifier.

    Methods

    • Sets this track as active, deactivating any currently active track. This should set sources on the playback source and add any listeners needed for shared resources.

      Parameters

      • loadOptions: LoadOptionsType

        Configuration from TrackLoadOptions.config, provided by the Application.

      Returns void

    • Clears any buffered or prefetched data, if applicable.

      Returns void

    • Sets this track as inactive. This should unset sources, and remove any listeners. Tracks do not implement disposable, when they are deactivated they are expected to be free for garbage collection if there are no longer references to the track.

      Returns void

    • Returns void

    • Returns true if the event host has any listeners.

      Returns boolean

    • Provides configuration to the track and begins preloading (if applicable).

      Parameters

      • trackOptions: TrackPreloadOptions

        Configuration provided by the TrackController.

      • loadOptions: LoadOptionsType

        Configuration from TrackLoadOptions.config, provided by the Application.

      Returns void

    • Resets the track to recover from error states. This will reset failed segments and clear error conditions to allow streaming to resume.

      Returns void