Vinyl
    Preparing search index...

    An MseTrack uses media source extensions for streaming.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _error: null | Error

    Sets on handleError, cleared on 'reset'.

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

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

    logPrefix: string

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

    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 bufferingEnded(): boolean

      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">>

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

      Parameters

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

      Returns void

    • 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

      • loadOptions: TrackBaseOptions

        Configuration from TrackLoadOptions.config, provided by the Application.

      Returns void

    • Clears all fetched fragments and source buffers. Streaming will resume. This should be called if a change has been made where the user would expect an immediate change, for example, changing streaming quality from SD to HD.

      Returns void

    • Returns void

    • Creates and adds a content stream for the given content type.

      Parameters

      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

    • 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

      Returns boolean

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

      Parameters

      Returns void

    • Returns void

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

      Parameters

      • trackOptions: TrackPreloadOptions

        Configuration provided by the TrackController.

      • loadOptions: TrackBaseOptions

        Configuration from TrackLoadOptions.config, provided by the Application.

      Returns void

    • Resets the track to recover from error states. Resets both the segment controller and buffering controller to clear failed segments and error conditions.

      Returns void

    • Returns a string representation of an object.

      Returns string