Vinyl
    Preparing search index...

    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

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _error: null | Error

    Sets on handleError, cleared on 'reset'.

    amazonTrack: true

    True if this is an Amazon track.

    asin: string

    MtsAttributesBase.asin

    disposer: Disposer
    drmSessionAbort: AbortSlot
    errorHandler: (error: any) => void
    loadOptions: null | SourceTrackBaseOptions

    The current load options, if this is an active track.

    logPrefix: string

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

    nerdStats: TrackNerdStats = ...

    Track metadata for nerd stats. null if not yet loaded.

    sampleResult: Promise<SampleResult>
    src: Promise<string>
    type: string

    The track type.

    uri: string

    The identifier of this track, used as the key in the track cache.

    Accessors

    • get "[toStringTag]"(): string

      Returns string

    • get active(): boolean

      True if the track is the currently playing track.

      Returns boolean

    • get contentTypes(): Readonly<Omit<Set<ContentType>, "clear" | "delete" | "add">>

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

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

    • get disposed(): boolean

      True if the track has been disposed.

      Returns boolean

    • get error(): null | Error

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

      Returns null | Error

    • get 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.

      Returns any

    • get 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.

      Returns ReadonlyRanges

    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

      Returns void

    • Clears any buffered or prefetched data, if applicable.

      Returns void

    • Returns void

    • 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

    • Dispatches an event.

      Type Parameters

      Parameters

      • type: K

        The key of the event within EventMap

      • event: StreamingEventMap[K]

        If the passed event is read-only, then it may be re-used/cached. Otherwise, it should be a new event object every dispatch. If no target property is set on the event, the target will be set to this host.

      Returns void

    • Returns void

    • The track has been activated. Operations on shared resources such as the playback controller may only be done while the track is currently active. For example if there is a loading operation before the playback source is set, isActive must be checked before the property is changed.

      Returns void

    • Returns void

    • Resets the track to recover from error states. Base implementation does nothing.

      Overrides should dispatch 'reset' after resetting error state.

      Returns void

    • Parameters

      • src: string

      Returns void

    • Returns a string representation of an object.

      Returns string