Amazon Vinyl
    Preparing search index...

    Class VinylPlayer<TrackLoadOptionsType, OptionsType>

    A Vinyl Media Player.

    Unless custom dependencies need to be provided, use createVinylPlayer to construct a new player implementation.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index
    client: Client

    Provides information about the client, such as device and browser capabilities.

    disposer: Disposer = ...
    logPrefix: string = ...

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

    • get fetchedTime(): number

      Returns the time of the prefetch end. If no data has been prefetched for the current track, 0 will be returned.

      The time given will be in seconds according to the media timeline. It will represent the ending time of the continuous prefetch range from the current playhead time.

      Returns number

    • get playbackRate(): number

      Sets the rate at which the media is being played back. This is used to implement user controls for fast-forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.

      Returns number

    • set playbackRate(value: number): void

      Sets the rate at which the media is being played back. This is used to implement user controls for fast-forward, slow motion, and so forth. The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.

      Parameters

      • value: number

      Returns void

    • get resetPending(): boolean

      True when an error has interrupted playback and an automatic reset is scheduled. This distinguishes transient, potentially recoverable errors (such as a brief network outage) from terminal errors that will not trigger a reset on their own.

      Listen to resetPendingChange events for changes.

      Returns boolean

    • 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

    • Sets options on this player. Options will be merged shallowly, for example, configure({ abr: { strategy: AbrStrategy.BEST }}) will replace all previous abr options, and not change other options such as loudnessNormalization.

      Parameters

      Returns void

    • Logs each republished load span once at the verbose level, formatting its bounds as ISO date strings and its duration in milliseconds.

      Returns void

    • 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: TrackLoadOptionsType[]

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

      Returns void

    • Pauses playback of the media, if the media is already in a paused state this method will have no effect. If a play is pending, the play will be aborted and the promise returned by play() will be rejected.

      Returns void

      • pendingPlay
      • play
    • Attempts to begin playback of the media. It returns a Promise which is resolved when playback has been successfully started.

      Failure to begin playback for any reason, such as permission issues or interruption via pause, results in the promise being rejected.

      The first time play() is invoked, except muted video, should be in response to a user interaction such as a button click.

      Returns Promise<void>

      isNotAllowedError

    • 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

    • Certain track events are redispatched on the player for the current track.

      Returns void

    • Safely seeks to the given time. The seek will begin only after readyState is at least PlaybackReadyState.HAVE_METADATA. If a previous seek was still pending, the previous seek will be ignored. Returns a Promise that resolves when the seek has completed. If the seek is interrupted by another seek, the promise will be rejected with an AbortError. If the seek is not to a seekable range, the promise will reject with an InvalidSeekError.

      Parameters

      • time: number

        The value, in seconds, to set the playback time.

      • Optionaltolerance: number

        The amount of tolerance to have when the time is outside the seekable ranges to snap, in seconds. If time is outside all seekable ranges beyond this tolerance, the seek will be ignored. Default: 0.5

      Returns Promise<void>

    • Skips the currently playing ad. If there are more ads in the break, the next ad begins; otherwise the break ends and content resumes. No-op when no ad break is active.

      Returns void

    • Skips the entire active ad break, advancing past all remaining ads and resuming content playback. No-op when no ad break is active.

      Returns void