Vinyl
    Preparing search index...

    Class SegmentControllerImpl

    Default SegmentController implementation. Provides segments for a given time. Handles segment prefetching and caching.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    contentType: ContentType
    logPrefix: string

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

    Accessors

    • get "[toStringTag]"(): string

      Returns string

    • get active(): boolean

      Returns boolean

    • get disposed(): boolean

      Returns boolean

    • get error(): null | Error

      Returns null | Error

    • get fetchedTime(): number

      Gets the number of seconds currently prefetched.

      Returns number

    • get startTime(): number

      Returns number

    • get trackPrefetchPriority(): number

      Returns number

    Methods

    • Indicates that this segment provider is providing segments for an active track and should be prioritized accordingly. Time ranges to be prefetched will change to the active prefetch window.

      Returns void

    • Clears the cached segments. Currently pending segment promises will be rejected with an abort reason.

      Returns void

    • Configures this segment provider and initiates prefetching. This may be called multiple times, for example when re-using a cached track a new track priority and start time can be provided.

      Parameters

      Returns void

    • Deactivates the segment provider. This clears cached segments not within the inactive prefetch range. Time ranges to be prefetched will change to the inactive prefetch window.

      Returns void

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

      Returns Promise<null | number>

    • Returns a Promise for a segment for the given time and currently selected media. The returned promise may abort with an AbortError if a seek occurs to outside the prefetch window.

      Parameters

      • time: number

        The time, in seconds, the requested segment should span.

      • Optionalabort: ReadonlyAbort

        Aborts the returned promise and releases the lock on prefetching. The segment request will not be interrupted unless the time goes out of prefetch ranges.

      Returns Promise<null | SegmentReference<ArrayBuffer>>

    • Resets failed segments to a pending state.

      Returns void