Options
All
  • Public
  • Public/Protected
  • All
Menu

Amazon IVS Player

Index

Type aliases

PlayerEventListener

PlayerEventListener<K>: (event: PlayerEventMap[K]) => void

A type representing the signature of a player event listener. This can be used by TypeScript implementations in order to safely type event listeners.

Type parameters

Type declaration

    • (event: PlayerEventMap[K]): void
    • Parameters

      • event: PlayerEventMap[K]

      Returns void

PlayerEventMap

A type mapping player event listener names to their handler function signatures. This can be used by TypeScript implementations in order to safely type event listeners.

StatePayloadMap

StatePayloadMap: {}

Maps PlayerState event names to their payload values. All state events return void.

Type declaration

Events

MetadataEventType

MetadataEventType:

An enumeration of available timed metadata events. Metadata events are fired when the playhead passes the start time of the metadata cue.

Listen to events with Player.addEventListener.

CAPTION

CAPTION: = "MetaCaption"
deprecated

Use {@link PlayerEventType.TEXT_CUES} instead.

param

Object Caption info

ID3

ID3: = "MetaID3"

Indicates that ID3 metadata has been parsed.

param

Object[] - List of ID3 keys and values

PlayerEventType

PlayerEventType:

An enumeration describing general events sent from the Player.

To listen to events, use Player.addEventListener.

AUDIO_BLOCKED

AUDIO_BLOCKED: = "PlayerAudioBlocked"

Indicates that the browser blocked unmuted playback. This behavior is based on the user's policy and can occur if the play request was made without a user gesture. To start playback, mute and play or wait for a user gesture.

param

void

BUFFER_UPDATE

BUFFER_UPDATE: = "PlayerBufferUpdate"

Indicates that the buffer size changed. This can be caused by an addition to or removal from the buffer.

updated

Player.getPosition Player.getBufferDuration Player.getBuffered

param

void

DURATION_CHANGED

DURATION_CHANGED: = "PlayerDurationChanged"

Indicates that source duration changed (or is available for the first time). This can occur after the PlayerState.READY state, to indicate a change in the duration of the media. This value can be set to Infinity or a large integer (1 << 30) for streams of unknown or indefinite length.

updated

Player.getDuration

param

number The updated duration, in seconds.

ERROR

ERROR: = "PlayerError"

Indicates that an error occurred. Errors are fatal and stop playback of the stream. The player moves into PlayerState.IDLE on fatal errors.

param

PlayerError

INITIALIZED

INITIALIZED: = "PlayerInitialized"

Indicates that the player was created.

updated

Player.getVersion

param

void

MUTED_CHANGED

MUTED_CHANGED: = "PlayerMutedChanged"

Indicates that the player was muted or unmuted.

updated

Player.isMuted

param

void

NETWORK_UNAVAILABLE

NETWORK_UNAVAILABLE: = "PlayerNetworkUnavailable"

Indicates that a playback unavailable event occurred.

param

void

PLAYBACK_BLOCKED

PLAYBACK_BLOCKED: = "PlayerPlaybackBlocked"

Indicates that playback is blocked from autoplaying; that is, without a user gesture. This event can fire when autoplay with sound is blocked or all autoplay is blocked. To start playback, mute and play, or wait for a user gesture.

param

void

PLAYBACK_RATE_CHANGED

PLAYBACK_RATE_CHANGED: = "PlayerPlaybackRateChanged"

Indicates that the playback rate changed.

updated

Player.getPlaybackRate

param

number The updated playback rate.

QUALITY_CHANGED

QUALITY_CHANGED: = "PlayerQualityChanged"

Indicates that the playing quality changed from either a user action or an internal adaptive-quality switch.

updated

Player.getQuality

param

Quality

REBUFFERING

REBUFFERING: = "PlayerRebuffering"

Indicates that the player is buffering from a previous PlayerState.PLAYING state. Excludes user actions such as seeking, starting, or resuming the stream.

param

void

SEEK_COMPLETED

SEEK_COMPLETED: = "PlayerSeekCompleted"

Indicates that the player seeked to a given position (as requested by Player.seekTo).

updated

Player.getPosition

param

number The position where the seek completed, in seconds.

TEXT_CUE

TEXT_CUE: = "PlayerTextCue"

Indicates that a text cue was parsed from the stream.

param

TextCue

TEXT_METADATA_CUE

TEXT_METADATA_CUE: = "PlayerTextMetadataCue"

Indicates that text metadata cues were parsed from the stream.

param

TextMetadataCue

TIME_UPDATE

TIME_UPDATE: = "PlayerTimeUpdate"

Indicates that the player position changed.

updated

Player.getPosition

param

number The updated position of the player, in seconds.

VOLUME_CHANGED

VOLUME_CHANGED: = "PlayerVolumeChanged"

Indicates that the player volume changed. Volume value can be between 0 and 1, inclusive.

updated

Player.getVolume

param

number The updated volume, between 0.0f and 1.0f.

PlayerState

PlayerState:

An enumeration describing Player state updates.

To listen to events, use Player.addEventListener.

BUFFERING

BUFFERING: = "Buffering"

Indicates that the Player is buffering content and playback stopped.

updated

Player.getState

param

void

ENDED

ENDED: = "Ended"

Indicates that the Player reached the end of a video or a live stream ends.

updated

Player.getState

param

void

IDLE

IDLE: = "Idle"

Indicates that the Player is idle or paused. This is the initial state.

updated

Player.getState

param

void

PLAYING

PLAYING: = "Playing"

Indicates that the Player is playing.

updated

Player.getState

param

void

READY

READY: = "Ready"

Indicates that the Player is ready to play the loaded video or live stream.

updated

Player.getState Player.getQualities

param

void

Variables

Const isPlayerSupported

isPlayerSupported: boolean

A boolean indicating whether the player is supported by the browser. The player is only supported in environments which support WebAssembly (WASM).

Functions

create

  • A function which creates a MediaPlayer instance.

    throws

    Throws an Error if WebAssembly is not supported by the browser. Check isPlayerSupported to determine support beforehand, or wrap in a try/catch block to prevent uncaught exceptions.

    Parameters

    Returns MediaPlayer

registerIVSQualityPlugin

  • registerIVSQualityPlugin(videojs: any): void
  • Registers the Amazon IVS quality plugin with Video.js. No-op if already registered.

    Once registered, you have access to the enableIVSQualityPlugin method on the Video.js object, which enables the quality UI toggle.

    throws

    Will throw a VideoJSError if video.js is not available

    Parameters

    • videojs: any

      video.js object.

    Returns void

registerIVSTech

  • Registers the Amazon IVS tech with Video.js. No-op if already registered.

    throws

    Will throw a VideoJSError if video.js or WebAssembly is not available

    Parameters

    Returns void

Generated using TypeDoc