Vinyl
    Preparing search index...

    Class TrackControllerImpl<TrackLoadOptionsType>

    Responsible for queuing track load configurations. This is the authority for which is the current track.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    logPrefix: string

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

    Accessors

    • get "[toStringTag]"(): string

      Returns string

    • get preloadCapacity(): number

      Returns the current preload capacity. This automatically increases when preload is called with more tracks than the current capacity.

      Returns number

    Methods

    • Clears all fetched fragments and source buffers. Playback will be interrupted, and streaming will resume again when data has been fetched and buffered. 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.

      Does not unload manifests.

      Returns void

    • Clears the current queue. Does not stop the current track or affect the prefetched cache.

      Returns void

    • Clears the track cache and unloads the current track.

      Returns void

    • Appends the given tracks to the current queue.

      Parameters

      Returns void

    • Returns the cached track for the given URI, or null if the track is not cached.

      Parameters

      • uri: string

      Returns null | ReadonlyTrack

    • Returns true if there is at least one track in the queue.

      Returns boolean

    • Returns true if the track with the given URI is cached.

      Parameters

      • uri: string

      Returns boolean

    • Sets the current queue to the provided track list. When the track ends, the next will be played.

      load does not begin playback. Call play() after a load to start playback. Browser autoplay policies may require the first call to play() to be in response to a user interaction such as a click, touch, keypress, or voice event.

      Note that if the current track is the first track provided in the list, that track will be restarted. To set the queue without unloading the current track, use clearQueue followed by enqueue.

      Parameters

      • ...loadOptionsList: readonly TrackLoadOptionsType[]

        A list of load configuration objects to set as a playback queue.

      Returns void

    • Activates the next track in the queue. If the media is not paused the next track will begin playing automatically.

      Returns void

      ReadonlyTrackController.hasNext

    • Preloads the given list of tracks. The tracks provided will not be enqueued. The track controller's cache size will automatically increase to accommodate the request.

      Prefetch priority note: Tracks have a prefetch priority, later calls to preload will have a higher precedence than previous calls. Previous tracks given to preload will drop off when they are evicted from the cache. This is dependent on cache size.

      Parameters

      Returns void

    • Resets the current track's error state.

      Returns void

    • Unloads the active track and clears the queue. This is the same as calling load with zero parameters.

      Returns void