Amazon Vinyl
    Preparing search index...

    Interface Track<ConfigType>

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

    interface Track<ConfigType extends TrackConfigOptions = TrackConfigOptions> {
        __eventMapType: Covariant<TrackEventMap>;
        active: boolean;
        contentTypes: ReadonlySet<ContentType>;
        disposed: boolean;
        error: Error | null;
        extra: any;
        fetchedRanges: ReadonlyRanges;
        logPrefix: string;
        qualities: readonly MediaQualityMetadata[] | null;
        qualitiesUnfiltered: readonly MediaQualityMetadata[] | null;
        seekRange: SeekRange | null;
        textTrackController: TextTrackController | null;
        type: string;
        uri: string;
        activate(loadOptions: Maybe<ConfigType>): void;
        clearPrefetch(): void;
        deactivate(): void;
        dispose(): void;
        getAds(): Promise<TrackAds>;
        getBufferingQuality(contentType: ContentType): MediaQualityMetadata | null;
        getPlaybackQuality(contentType: ContentType): MediaQualityMetadata | null;
        getStreamingQuality(contentType: ContentType): MediaQualityMetadata | null;
        hasAnyListeners(): boolean;
        hasListeners(type: (keyof StreamingEventMap) | "adsChange"): boolean;
        on<K extends (keyof StreamingEventMap) | "adsChange">(
            type: K,
            handler: EventHandler<TrackEventMap[K]>,
            options?: SignalOptions,
        ): Unsubscribe;
        preload(
            trackOptions: TrackPreloadOptions,
            loadOptions: Maybe<ConfigType>,
        ): void;
        reset(hard?: boolean): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Implemented by

    Index
    __eventMapType: Covariant<TrackEventMap>
    active: boolean

    True if the track is the currently playing track.

    contentTypes: ReadonlySet<ContentType>

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

    disposed: boolean

    True if this track is disposed.

    error: Error | null

    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.

    qualities: readonly MediaQualityMetadata[] | null

    The available qualities for the current period, after filtering. Null if the timeline is not yet available.

    qualitiesUnfiltered: readonly MediaQualityMetadata[] | null

    The available unfiltered qualities for the current period. Null if the timeline is not yet available.

    seekRange: SeekRange | null

    The seekable range on the media timeline, or null when not yet known (e.g. before the manifest is loaded). Based on the media timeline, not the element's native seekable ranges.

    textTrackController: TextTrackController | null

    Mutable view of ReadonlyTrack.textTrackController that allows selecting the active text track.

    type: string

    The type of track.

    uri: string

    The track identifier.

    • 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: Maybe<ConfigType>

        Configuration from TrackLoadOptions.config, provided by the Application.

      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 true if the event host has any listeners for the given type.

      Parameters

      • type: (keyof StreamingEventMap) | "adsChange"

      Returns boolean

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

      Parameters

      • Optionalhard: boolean

        If true, the track will reset the playback state and recreate media sources.

      Returns void