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

AudioPlayer is a component that implements the HTMLAudioElement interface
  • that extends HTMLMediaElement interface.

Remarks

This is a typescript class and not a react native component. Apps
  • need to create an instance of AudioPlayer and use it to start buffering
  • the content without starting playback. It does not render the media controls GUI.
  • Apps are expected to build their own media controls UI and control the playback experience.

Extends

  • MediaPlayer

Constructors

new AudioPlayer()

new AudioPlayer(audioType?, audioUsage?): AudioPlayer

Parameters

audioType?
AudioContentType Type of audio to play.
audioUsage?
AudioUsageType Reason for audio playback.

Returns

AudioPlayer

Brief

Creates a AudioPlayer 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.

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.

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.

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.

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.

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.

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.

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

deinitialize()

deinitialize(): Promise<void>

Returns

Promise<void> Promise that is resolved when the 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

initialize()

initialize(): Promise<void>

Returns

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

Brief

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

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

triggerTMOAIfNeeded()

triggerTMOAIfNeeded(cue): void

Parameters

cue
TextTrackCue

Returns

void

Inherited from

MediaPlayer.triggerTMOAIfNeeded
Last modified on February 25, 2026