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

AudioPlayer

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

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 | undefined

Type of audio to play.

audioUsage?

AudioUsageType | undefined

Reason for audio playback.

Returns

AudioPlayer

Methods

deinitialize()

deinitialize(): Promise<void>

DeInitiailzes the player.

Returns

Promise<void>

Promise that is resolved when the player is deinitialized.


deinitializeSync()

deinitializeSync(timeoutInMs: number): MediaPlayerDeInitStatus

DeInitiailzes the player synchronously

Parameters

timeoutInMs

number

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

Returns

MediaPlayerDeInitStatus

MediaPlayerDeInitStatus


initialize()

initialize(): Promise<void>

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

Returns

Promise<void>

Promise that is resolved when the player is initialized.


setMediaControlFocus()

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

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

Parameters

componentInstance

IComponentInstance

mediaControlHandler?

any

Returns

Promise<void>


Last updated: Jul 22, 2026