Class

player/extension/HTML5PlayerAudioTrack

player/extension/HTML5PlayerAudioTrack()

Constructor

# new player/extension/HTML5PlayerAudioTrack()

HTML5 Player audio track strategy for the HTML5 Player audio track extension

Implements:
  • interfaces/AudioTrackStrategy

Methods

# getAudioTrackAttribute(id, attribute, defaultValue) → {Promise.<String>}

Retrieve audio track attribute.

Parameters:
Name Type Description
id String

the target track id

attribute String

the attribute key

defaultValue String

the defaultValue

IllegalState
IllegalArgument

Native Promise.

Promise.<String>

# getAudioTracks() → {Promise.<Array.<player/extension/HTML5PlayerAudioTrack#AudioTrack>>}

Returns an array of all known audio tracks. This function does not returns the external:AudioTrackList or external:AudioTrack[].

Native Promise.

# getCurrentAudioTrack() → {Promise.<player/extension/HTML5PlayerAudioTrack#AudioTrack>}

Return the information about the current audio track.

IllegalState

Native Promise.

# prepare(player) → {void}

To prepare the audio track, it will load the strategies and prepare them.

Parameters:
Name Type Description
player interfaces/Player

the player

void

# setAudioTrack(id) → {Promise.<true>}

Set the current audio track to the one specified.

Parameters:
Name Type Description
id String

the target track id

IllegalState
IllegalArgument

Native Promise.

Promise.<true>

Type Definitions

Object

# AudioTrack

XDK audio track metadata object.

Properties:
Name Type Description
id Integer

The index of the metadata object in the audio track array.

name String

The name of the audio track as reported by the player.