ProtectedconstructorConstructs a new VinylPlayer with the given dependency factories. This constructor is protected, use createVinylPlayer to construct a new player.
ReadonlyclientProvides information about the client, such as device and browser capabilities.
Protected ReadonlydepsProtected ReadonlydisposerReadonlylogA string prefix for all log statements made by this target.
The currently active text track, or null if no track is selected.
The active track, or null when the selected track has not yet activated (e.g. behind a preroll) or nothing is loaded.
Returns a new static normalized ReadonlyRanges object that represents the ranges of the media resource, if any, that the user agent has buffered at the moment the buffered property is accessed.
Note: ReadonlyRanges is a view to the DOM TimeRanges object.
True if the readyState is PlaybackReadyState.HAVE_FUTURE_DATA This will be true after a PlaybackControllerEventMap.canPlay event.
Note that security permissions may not allow a track to load past metadata before there has been a user interaction. This should not be relied upon before invoking PlaybackController.play.
True if the readyState is PlaybackReadyState.HAVE_ENOUGH_DATA This will be true after a PlaybackControllerEventMap.canPlayThrough event.
Note that security permissions may not allow a track to load past metadata before there has been a user interaction. This should not be relied upon before invoking PlaybackController.play.
Returns the current content types for active streams.
The ad currently playing within the active break, or null when the playhead is in primary content.
Listen to AdEventMap.adEntered and AdEventMap.adCompleted for transitions.
The ad break currently containing the playhead, or null when the playhead is in primary content.
Listen to AdEventMap.adBreakEntered and AdEventMap.adBreakCompleted for transitions.
The current playback time in seconds. When changed, a 'timeUpdate' event is emitted.
Returns current time as a percent of the total duration.
A number between 0-1
The current track's ad breaks.
Listen to AdEventMap.currentTrackAdsChange for changes.
The default playback rate when the user is not using fast forward or reverse for a video or audio resource.
The default playback rate when the user is not using fast forward or reverse for a video or audio resource.
Returns true if this player has been disposed.
The length of the element's media in seconds.
Observe changes with durationChange events.
Indicates whether the media element has ended playback.
The last error reported.
Returns the fetched ranges of the current track. If there is no current track, empty ranges will be returned.
Listen to VinylPlayerEventMap.fetchedRangesChange for changes.
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 current fetched time as a percent of the total duration.
A number between 0-1
True if the readyState is at least PlaybackReadyState.HAVE_METADATA
This will be true after a PlaybackControllerEventMap.loadedMetadata event and false after an PlaybackControllerEventMap.emptied event.
Controls whether the media element should start over when it reaches the end.
Controls whether the media element should start over when it reaches the end.
Indicates whether the media element muted.
Observe changes with mutedChange events.
Indicates whether the media element muted.
Observe changes with mutedChange events.
Indicates the current state of the fetching of media over the network.
Returns the current player options.
Use configure to set.
Indicates whether the media element is paused.
Observe changes with play and pause events.
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.
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.
True if playback has started, is not paused, stalled, or seeking. Observe changes with 'playing' and 'played' events.
True if play has been called and the returned promise is currently in a pending state.
Observe changes with PlaybackControllerEventMap.playIsPendingChange events.
Determines whether the browser should adjust the pitch of the audio to compensate for changes to the playback rate. Default: true
Determines whether the browser should adjust the pitch of the audio to compensate for changes to the playback rate. Default: true
The available qualities for the current period of the current track, after filtering. Null if no track is active or the timeline is not yet available.
The available unfiltered qualities for the current period of the current track. Null if no track is active or the timeline is not yet available.
Returns the current queue of TrackLoadOptions. Observe 'queueChange' for changes to this queue.
Indicates the readiness state of the media. Observe changes with PlaybackControllerEventMap.readyStateChange events.
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 a new static normalized ReadonlyRanges object that represents the ranges of the
media resource, if any, that the user agent is able to seek to at the time seekable
property is accessed.
Note: ReadonlyRanges is a view to the DOM TimeRanges object.
True if the element is currently seeking.
Observe changes with seeking and seeked events.
The seekable range on the media timeline for the current track, or null when no track is loaded or the timeline is not yet resolved.
The list of currently discovered sidecar text tracks for the active media. Empty when there is no current track or the current track carries no text.
The volume level for audio portions of the media element.
Observe changes with volumeChange events.
The volume level for audio portions of the media element.
Observe changes with volumeChange events.
True if playback is stopped due to waiting for data.
Observe changes with waiting and waited events.
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.
Clears the current queue. Does not stop the current track or affect the prefetched cache.
Clears the track cache, unloads the current track, and clears the queue.
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.
Dispatches an event.
The key of the event within EventMap
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.
Disposes this player and sub-systems.
Appends the given tracks to the current queue.
The track load configurations to append.
The currently buffering quality, or null if no data is buffered.
Returns the cached track for the given URI, or null if the track is not cached.
Returns an iterator of currently cached tracks.
The currently playing quality, or null if no media is playing.
The streaming quality for the current track. Note that this does not represent the quality of inactive preloading tracks.
Returns true if the event host has any listeners.
Returns true if the event host has any listeners for the given type.
Returns true if there is at least one track in the queue.
ProtectedinitializeLogs each republished load span once at the verbose level, formatting its bounds as ISO date strings and its duration in milliseconds.
Returns true if the track with the given URI is cached.
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.
A list of load configuration objects to set as a playback queue.
Adds an event handler for the given typed event.
The key representing the event type to listen for.
A callback to invoke when the event with the given type is dispatched.
Optionaloptions: SignalOptions
Options for changing listening behavior.
Returns a method, when invoked, removes the handler.
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.
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.
ProtectedredispatchCertain track events are redispatched on the player for the current track.
ProtectedredispatchResets the error state.
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.
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
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.
Skips the entire active ad break, advancing past all remaining ads and resuming content playback. No-op when no ad break is active.
Unloads the active track and clears the queue. This is the same as calling load with zero parameters.
A Vinyl Media Player.
Unless custom dependencies need to be provided, use createVinylPlayer to construct a new player implementation.