Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Skip to main content

Brief

VideoPlayer is a component that implements the HTMLVideoElement interface that extends HTMLMediaElement interface.

Remarks

This is a typescript class and not a react native component. Apps need to create an instance of VideoPlayer and use it to start buffering the content without rendering video on screen. It doesn’t render video to the screen by default, nor does it render the media controls GUI. Apps are expected to build their own media controls UI and control the playback experience. When the app wants to show the video on screen, it must add KeplerVideoSurfaceView React Native component to the render tree, receive onSurfaceViewCreated event and pass the surface handle obtained in the event callback to VideoPlayer through the setSurfaceHandle API.

Extends

  • MediaPlayer

Implements

Constructors

new VideoPlayer()

new VideoPlayer(): VideoPlayer

Returns

VideoPlayer

Brief

Constructor to create a video player instance

Overrides

MediaPlayer.constructor

Properties

controls?

optional controls: boolean Enable or disable the UI for media controls. For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-controls.

Implementation of

HTMLVideoElement.controls

Inherited from

MediaPlayer.controls

mediaControlHandler

mediaControlHandler: KeplerMediaControlHandler = null

Inherited from

MediaPlayer.mediaControlHandler

mediaControlServer

mediaControlServer: IMediaControlServerAsync

Inherited from

MediaPlayer.mediaControlServer

mediaControlStateUtil

mediaControlStateUtil: MediaControlStateUtil = null

Inherited from

MediaPlayer.mediaControlStateUtil

mediaKeys?

optional mediaKeys: MediaKeys

Brief

The media keys to use to decrypt DRM protected content. For additional information, see https://www.w3.org/TR/encrypted-media/#dom-htmlmediaelement-mediakeys.

Implementation of

HTMLVideoElement.mediaKeys

Inherited from

MediaPlayer.mediaKeys

mSessionId

mSessionId: IMediaSessionId

Inherited from

MediaPlayer.mSessionId

newlyIntroducedCues

newlyIntroducedCues: Set<VTTCue>

TODO

Create a TextTrackManager and TextTrackRenderer.

Inherited from

MediaPlayer.newlyIntroducedCues

seekIntervalInSec_

seekIntervalInSec_: number = DEFAULT_SEEK_SECONDS

Inherited from

MediaPlayer.seekIntervalInSec_

tmoa?

optional tmoa: TimeMarchesOnAlgo = null

Inherited from

MediaPlayer.tmoa

HAVE_CURRENT_DATA

readonly static HAVE_CURRENT_DATA: number = 2 For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have\_current\_data.

Implementation of

HTMLVideoElement.HAVE_CURRENT_DATA

Inherited from

MediaPlayer.HAVE_CURRENT_DATA

HAVE_ENOUGH_DATA

readonly static HAVE_ENOUGH_DATA: number = 4 For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have\_enough\_data.

Implementation of

HTMLVideoElement.HAVE_ENOUGH_DATA

Inherited from

MediaPlayer.HAVE_ENOUGH_DATA

HAVE_FUTURE_DATA

readonly static HAVE_FUTURE_DATA: number = 3 For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have\_future\_data.

Implementation of

HTMLVideoElement.HAVE_FUTURE_DATA

Inherited from

MediaPlayer.HAVE_FUTURE_DATA

HAVE_METADATA

readonly static HAVE_METADATA: number = 1 For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have\_metadata.

Implementation of

HTMLVideoElement.HAVE_METADATA

Inherited from

MediaPlayer.HAVE_METADATA

HAVE_NOTHING

readonly static HAVE_NOTHING: number = 0 For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have\_nothing.

Implementation of

HTMLVideoElement.HAVE_NOTHING

Inherited from

MediaPlayer.HAVE_NOTHING

isAppManifestParsed

static isAppManifestParsed: boolean = false

Inherited from

MediaPlayer.isAppManifestParsed

isPlayerSessionEnabled

static isPlayerSessionEnabled: boolean = true

Inherited from

MediaPlayer.isPlayerSessionEnabled

mediaSessionID_

static mediaSessionID_: number = 0

Inherited from

MediaPlayer.mediaSessionID_

playerSessionClient

static playerSessionClient: PlayerSessionClient = null

Inherited from

MediaPlayer.playerSessionClient

Accessors

pitchMultiplier

Get Signature

get pitchMultiplier(): number
Brief
Returns the current pitch multiplier set for the audio stream.
Since
2.2.0
Returns
number The current pitch multiplier set for the audio stream. Return NaN if MediaElement is not yet created, or if pipeline is not ready.

Set Signature

set pitchMultiplier(_pitchMultiplier): void
Brief
Sets the pitch multiplier of the audio stream.
Note
This param will not work with passthrough audio e.g. Dolby audio.
Since
2.2.0
Parameters
_pitchMultiplier
number The pitch multiplier for audio playback. Valid range: 0.1 to 10.0 (inclusive) 1.0 represents normal pitch (default) Values > 1.0 increase pitch Values < 1.0 decrease pitch
Returns
void

Inherited from

MediaPlayer.pitchMultiplier

Methods

addCue()

addCue(cue): void TextTrackManager Should take care of these

Parameters

cue
TextTrackCue

Returns

void

Inherited from

MediaPlayer.addCue

clearCaptionViewHandle()

clearCaptionViewHandle(captionViewHandle): void

Parameters

captionViewHandle
string

Returns

void

Brief

Clears the captions view handle to the player. @param[in] captionViewHandle Handle to the captions view.

Inherited from

MediaPlayer.clearCaptionViewHandle

clearSurfaceHandle()

clearSurfaceHandle(surfaceHandle): void

Parameters

surfaceHandle
string

Returns

void

Brief

Sets the surface handle to which video is rendered. @param[in] surfaceHandle The surface handle returned by onSurfaceViewCreated event emitted by KeplerVideoSurfaceView component.

deinitialize()

deinitialize(): Promise<void>

Returns

Promise<void> Promise that is resolved when player is deInitialized.

Brief

DeInitiailzes the player.

Overrides

MediaPlayer.deinitialize

deinitializeSync()

deinitializeSync(timeoutInMs): MediaPlayerDeInitStatus

Parameters

timeoutInMs
number time out threshold set by client to return the deinit control.

Returns

MediaPlayerDeInitStatus MediaPlayerDeInitStatus

Brief

DeInitiailzes the player synchronously

Overrides

MediaPlayer.deinitializeSync

getVideoPlaybackQuality()

getVideoPlaybackQuality(): VideoPlaybackQuality

Returns

VideoPlaybackQuality

Brief

Fetches video playback quality attributes.

Implementation of

HTMLVideoElement.getVideoPlaybackQuality

initialize()

initialize(): Promise<void>

Returns

Promise<void> Promise that is resolved when player is initialized..

Brief

Initiailzes the player. Wait for the promise to be fulfilled before calling any other fucntion.

Overrides

MediaPlayer.initialize

removeAttribute()

removeAttribute(name): void

Parameters

name
string

Returns

void

Brief

DOM-like removeAttribute method

Inherited from

MediaPlayer.removeAttribute

removeCue()

removeCue(cue): void

Parameters

cue
TextTrackCue

Returns

void

Inherited from

MediaPlayer.removeCue

runTMOAlgo()

runTMOAlgo(): void

Returns

void

Inherited from

MediaPlayer.runTMOAlgo

setCaptionViewHandle()

setCaptionViewHandle(captionViewHandle): void

Parameters

captionViewHandle
string

Returns

void

Brief

Sets the captions view handle to the player. @param[in] captionViewHandle Handle to the captions view.

Inherited from

MediaPlayer.setCaptionViewHandle

setMediaControlFocus()

setMediaControlFocus(componentInstance, mediaControlHandler?): Promise<void>

Parameters

componentInstance
IComponentInstance
mediaControlHandler?
IMediaControlHandlerAsync

Returns

Promise<void>

Brief

setup the component instance with current mediaplayer being used and pass mediaControlHandler in case client wants to opt handling of mediacontrol commands.

Overrides

MediaPlayer.setMediaControlFocus

setSurfaceHandle()

setSurfaceHandle(surfaceHandle): void

Parameters

surfaceHandle
string

Returns

void

Brief

Sets the surface handle to which video is rendered. @param[in] surfaceHandle The surface handle returned by the onSurfaceViewCreated event emitted by KeplerVideoSurfaceView component.

triggerTMOAIfNeeded()

triggerTMOAIfNeeded(cue): void

Parameters

cue
TextTrackCue

Returns

void

Inherited from

MediaPlayer.triggerTMOAIfNeeded
Last modified on February 25, 2026