# new media/AudioTrack()
Reimplementation of Audio Track Extension.
This is to support loading of audio track strategy for XDK Player.
- Implements:
Methods
# async getAudioTrackAttribute(id, attribute, defaultValueopt) → {Promise.<String>}
Retrieve audio track attribute.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
id |
String
|
Targetted track ID. |
|
attribute |
String
|
Attribute key. |
|
defaultValue |
String
|
<optional> |
The default value to return if retrieval failed. |
IllegalArgument
Native Promise.
Promise.<String>
# async getAudioTracks() → {Promise.<Array.<Object>>}
Return an array of known audio tracks.
IllegalState
IllegalArgument
Native Promise.
Promise.<Array.<Object>>
# async getCurrentAudioTrack() → {Promise.<?{(Object|Integer)}>}
Return the information about the current audio track.
Promise.
Promise.<?{(Object|Integer)}>
# async prepare(player, optionsopt) → {Promise.<void>}
Import the player specific audio track strategy, and prepare it.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
player |
Player
|
XDK Player instance. |
|
options |
Object
|
<optional> |
Optional player option, with or without audioTrack specific details. |
- Implements:
Native Promise.
Promise.<void>
# async setAudioTrack(id) → {Promise.<true>}
Set the current audio track to the one specified.
Parameters:
Name | Type | Description |
---|---|---|
id |
String
|
Targetted track ID. |
IllegalState
IllegalArgument
Native Promise.
Promise.<true>