Amazon Vinyl
    Preparing search index...

    Interface VinylPlayerEventMap<TrackLoadOptionsType>

    Events the Vinyl Player emits.

    interface VinylPlayerEventMap<
        TrackLoadOptionsType extends TrackLoadOptions = VinylTrackLoadOptions,
    > {
        abort: AnyRecord;
        activeTextTrackChange: ChangeEvent<TextTrackInfo | null>;
        adBreakCompleted: AdBreakCompleteEvent;
        adBreakEntered: AdBreakEvent;
        adCompleted: AdCompleteEvent;
        adEnded: AdProgressEvent;
        adEntered: AdEvent;
        adError: AdErrorEvent;
        adFirstQuartile: AdProgressEvent;
        adMidpoint: AdProgressEvent;
        adPlaying: AdEvent;
        adPreload: AdBreakEvent;
        adThirdQuartile: AdProgressEvent;
        adTimeUpdate: AdTimeUpdateEvent;
        bufferingEnded: AnyRecord;
        bufferingQualityChange: ChangeEvent<MediaQualityMetadata | null>;
        canPlay: AnyRecord;
        canPlayThrough: AnyRecord;
        codecUnsupported: CodecUnsupportedEvent;
        contentTypesChange: ChangeEvent<ReadonlySet<ContentType>>;
        currentTrackAdsChange: ChangeEvent<TrackAds | null>;
        durationChange: ChangeEvent<number>;
        emptied: AnyRecord;
        ended: AnyRecord;
        error: BasicErrorEvent;
        fetchedRangesChange: AnyRecord;
        loadedData: AnyRecord;
        loadedMetadata: AnyRecord;
        loadSpan: LoadSpanEvent;
        loadSpanMeasured: LoadSpanMeasurement;
        loadStart: AnyRecord;
        looped: AnyRecord;
        mutedChange: ChangeEvent<boolean>;
        pause: AnyRecord;
        play: AnyRecord;
        playbackQualityChange: ChangeEvent<MediaQualityMetadata | null>;
        played: PlayedEvent;
        playing: AnyRecord;
        playIsPendingChange: ChangeEvent<boolean>;
        playRejected: PlayRejectedEvent;
        progress: ProgressEvent;
        qualitiesChange: ChangeEvent<readonly MediaQualityMetadata[]>;
        qualitiesUnfilteredChange: ChangeEvent<readonly MediaQualityMetadata[]>;
        queueChange: ChangeEvent<readonly TrackLoadOptionsType[]>;
        queueEnded: AnyRecord;
        rateChange: ChangeEvent<number>;
        readyStateChange: ChangeEvent<PlaybackReadyState>;
        reset: AnyRecord;
        resetPendingChange: ChangeEvent<boolean>;
        resize: AnyRecord;
        seeked: OperationCompletedEvent<"emptied" | "seeked" | "playing">;
        seeking: AnyRecord;
        seekRangeChange: ChangeEvent<SeekRange | null>;
        stallEnded: OperationCompletedEvent<StallEndedReason>;
        stallEntered: AnyRecord;
        streamingQualityChange: ChangeEvent<MediaQualityMetadata | null>;
        textTrackError: TextTrackErrorEvent;
        textTracksChange: ChangeEvent<readonly TextTrackInfo[]>;
        timeUpdate: ChangeEvent<number>;
        trackActivated: TrackLifecycleEvent;
        trackDeactivated: TrackLifecycleEvent;
        trackEnded: TrackEndedEvent;
        volumeChange: ChangeEvent<number>;
        waited: OperationCompletedEvent<WaitedReason>;
        waiting: AnyRecord;
        waitingForKey: AnyRecord;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index
    abort: AnyRecord

    Fired when the resource was not fully loaded, but not as the result of an error.

    activeTextTrackChange: ChangeEvent<TextTrackInfo | null>

    Emitted when the active text track changes.

    adBreakCompleted: AdBreakCompleteEvent

    Dispatched when the current ad break has completed: all of its ads played, were skipped, it hit its playout limit, or it had no ads. Carries the position at which primary content resumes.

    adBreakEntered: AdBreakEvent

    Dispatched when an ad break has been entered — its ads may still be resolving. An ad break may contain one or more ads.

    adCompleted: AdCompleteEvent

    Dispatched when an ad has stopped playing for any reason such as ended, error, or skipped.

    Dispatched when an ad has played through 100%. Will be dispatched before adCompleted.

    adEntered: AdEvent

    Dispatched when an ad region has been entered.

    adError: AdErrorEvent

    An ad list or an individual ad failed to complete.

    adFirstQuartile: AdProgressEvent

    Dispatched when an ad has played through 25%.

    adMidpoint: AdProgressEvent

    Dispatched when an ad has played through 50%.

    adPlaying: AdEvent

    Dispatched when an ad has started playing.

    adPreload: AdBreakEvent

    Dispatched when the playhead approaches a midroll or postroll break — within the break's resolution/preload window — so its ad assets can be resolved and warmed ahead of entry. Fires once per break as it is approached (again after a seek back re-arms a replayable break). Prerolls are preloaded up front and do not emit this.

    adThirdQuartile: AdProgressEvent

    Dispatched when an ad has played through 75%.

    adTimeUpdate: AdTimeUpdateEvent

    Dispatched on each playback progress tick while an ad is active, carrying the elapsed and remaining time for both the current ad and the whole ad break. Applications should prefer this over deriving ad timing from the media element's duration.

    bufferingEnded: AnyRecord

    The last segment has finished appending.

    bufferingQualityChange: ChangeEvent<MediaQualityMetadata | null>

    Dispatched when the currently buffering quality changes. This is dispatched before the segment is appended.

    canPlay: AnyRecord

    Fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.

    readyState will be at least PlaybackReadyState.HAVE_FUTURE_DATA

    canPlayThrough: AnyRecord

    Fired when the user agent can play the media, and estimates that enough data has been loaded to play the media up to its end without having to stop for further buffering of content.

    readyState will be at least PlaybackReadyState.HAVE_ENOUGH_DATA

    codecUnsupported: CodecUnsupportedEvent

    A codec the browser reported as supported failed to decode on append and has been denylisted at runtime. The current media should be reloaded so quality selection can fall back to a codec that decodes. Recoverable: this is dispatched instead of an error, and the player reloads the track in response.

    contentTypesChange: ChangeEvent<ReadonlySet<ContentType>>

    The actively streamed content types have changed.

    currentTrackAdsChange: ChangeEvent<TrackAds | null>

    Emitted when the set of known ad breaks for the current media changes, for example when a live manifest reveals a new break.

    durationChange: ChangeEvent<number>

    Fired when the duration attribute has been updated.

    emptied: AnyRecord

    Fired when the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.

    readyState will be PlaybackReadyState.HAVE_NOTHING

    ended: AnyRecord

    Fired when playback or streaming has stopped because the end of the media was reached or because no further data is available.

    Dispatched when the media element dispatches an error.

    fetchedRangesChange: AnyRecord

    fetchedRanges have been updated.

    loadedData: AnyRecord

    Fired when the frame at the current playback position of the media has finished loading; often the first frame.

    readyState will be at least PlaybackReadyState.HAVE_CURRENT_DATA

    loadedMetadata: AnyRecord

    Fired when the metadata has been loaded.

    readyState will be at least PlaybackReadyState.HAVE_METADATA

    loadSpan: LoadSpanEvent

    A stage of a track load completed. Reports the time span of the stage together with the track it belongs to. Consumers measuring end-to-end load latency key on the first event per kind and trackUri.

    loadSpanMeasured: LoadSpanMeasurement

    A stage of the track load completed. Rather than redispatch this raw measurement, the player attributes it to the current track and republishes it as the loadSpan event.

    loadStart: AnyRecord

    Fired when the browser has started to load a resource.

    looped: AnyRecord

    Fired when ReadonlyPlaybackController.loop is true and playback has looped to track beginning.

    mutedChange: ChangeEvent<boolean>

    Fired when the mute status has changed.

    pause: AnyRecord

    Fired when a request to pause an activity is handled and the activity has entered its paused state, most commonly after the media has been paused through a call to the element's pause() method.

    play: AnyRecord

    Fired when the paused property is changed from true to false, as a result of the play method, or the autoplay attribute.

    playbackQualityChange: ChangeEvent<MediaQualityMetadata | null>

    The currently playing quality has changed.

    played: PlayedEvent

    Fired when playback has stopped, for any reason.

    When media begins playing, a playing event is emitted. If playback stops due to 'pause', 'seeking', 'emptied', 'waiting', or 'ended', then played will be fired.

    playing: AnyRecord

    Fired after playback is first started, and whenever it is restarted. For example, it is fired when playback resumes after having been paused or delayed due to lack of data.

    playIsPendingChange: ChangeEvent<boolean>
    playRejected: PlayRejectedEvent

    Fired if play() has been attempted, but rejected.

    progress: ProgressEvent

    Fired periodically as the browser loads a resource.

    qualitiesChange: ChangeEvent<readonly MediaQualityMetadata[]>

    The available qualities for the current period have changed.

    qualitiesUnfilteredChange: ChangeEvent<readonly MediaQualityMetadata[]>

    The available unfiltered qualities for the current period have changed.

    queueChange: ChangeEvent<readonly TrackLoadOptionsType[]>

    Dispatched when the queue has changed.

    Will be emitted before trackActivated.

    queueEnded: AnyRecord

    Emitted when the last track of the playback queue (and any of its postroll ads) have ended.

    rateChange: ChangeEvent<number>

    Fired when the playback rate has changed.

    readyStateChange: ChangeEvent<PlaybackReadyState>

    Fired when ReadonlyPlaybackController.readyState has changed.

    This is fired when any of the following events have fired: loadedData, loadedMetadata canPlay canPlayThrough emptied waiting

    reset: AnyRecord

    Emitted when the error state has been reset.

    resetPendingChange: ChangeEvent<boolean>

    Dispatched when VinylPlayer.resetPending changes.

    current is true when the player has hit a transient, potentially recoverable error (e.g. a network outage) and an automatic reset attempt is scheduled. current is false once the pending reset is emitted, the error is cleared, or all retries are exhausted.

    If resetPending becomes false while VinylPlayer.error is still non-null, all automatic reset attempts have been exhausted and playback will not recover without user action.

    resize: AnyRecord

    Fired when the intrinsic dimensions of the media (e.g. a video's width or height) change, including once they first become known.

    seeked: OperationCompletedEvent<"emptied" | "seeked" | "playing">

    Fired when a seek operation completed, the current playback position has changed, and the Boolean seeking attribute is changed to false.

    seeking: AnyRecord

    Fired when a seek operation starts, meaning the Boolean seeking attribute has changed to true and the media is seeking a new position.

    seekRangeChange: ChangeEvent<SeekRange | null>

    The seekable range on the media timeline has changed.

    Fired when a stall (see stallEntered) has ended, for any reason. started is the time of the last timeUpdate observed before the play head froze, and duration is the total number of seconds the play head was frozen.

    stallEntered: AnyRecord

    Fired when the play head has been detected as frozen while playing — i.e. no timeUpdate was observed for longer than the stall threshold. Only emitted once playback has actually been observed (a playing event), so it is not emitted during initial loading or while awaiting a seek. Each stall is bracketed by a stallEntered/stallEnded pair.

    streamingQualityChange: ChangeEvent<MediaQualityMetadata | null>

    Dispatched when the currently streaming quality changes. This is dispatched when a new streaming quality has been requested.

    textTrackError: TextTrackErrorEvent

    Emitted when an error occurs while loading or activating a text track.

    textTracksChange: ChangeEvent<readonly TextTrackInfo[]>

    Emitted when the available text tracks change.

    timeUpdate: ChangeEvent<number>

    Fired when the time indicated by the currentTime attribute has been updated.

    trackActivated: TrackLifecycleEvent

    A track became active. For content this may be deferred behind a preroll; for an ad it fires as the ad activates. queueChange precedes it.

    trackDeactivated: TrackLifecycleEvent

    A previously-active track was torn down (superseded or unloaded).

    trackEnded: TrackEndedEvent

    Emitted when the current track — including any postroll ads — has finished playing. Fires once per track: as the queue advances it precedes the resulting trackActivated, and for the final track it precedes queueEnded. Distinct from the media element's ended (which also fires for each ad) and from an individual ad's adEnded, so applications can act on true track completion (e.g. logging a play) without confusing it with an ad ending or the content ending before its postroll plays.

    volumeChange: ChangeEvent<number>

    Fired when the volume has changed.

    Fired when waiting has completed. This will be emitted after a waiting event when playback has resumed, paused, or unloaded.

    waiting: AnyRecord

    Fired when playback has stopped because of a temporary lack of data.

    Note: this includes during initial loading or after a seek and data is needed to buffer. Will not be emitted when paused.

    waitingForKey: AnyRecord

    Playback is blocked waiting for a key.