The audio track strategy interface
Methods
# getAudioTrackAttribute(id, attribute, defaultValue) → {Promise.<String>}
To get the audio track attribute
Parameters:
Name | Type | Description |
---|---|---|
id |
String
|
the target track id |
attribute |
String
|
the attribute key |
defaultValue |
String
|
the defaultValue |
IllegalArgument
Native Promise.
Promise.<String>
# getAudioTracks() → {Promise.<Object>}
To get the audio tracks
IllegalState
IllegalArgument
Native Promise.
Promise.<Object>
# getCurrentAudioTrack() → {Promise.<String>}
To get the current audio track
Native Promise.
Promise.<String>
# prepare(player, audioTrackOptionopt) → {Promise}
To prepare the audio track, it will load the strategies and prepare them
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
player |
interfaces/Player
|
the player |
|
audioTrackOption |
AudioObject
|
<optional> |
the audio track options |
Native Promise.
Promise
# setAudioTrack(id) → {Promise}
To set the audio track
Parameters:
Name | Type | Description |
---|---|---|
id |
String
|
the target track id |
IllegalState
IllegalArgument
Native Promise.
Promise
Type Definitions
Object
# AudioObject
Audio Object definition. Used on the audio tracks methods. Based on Audio Track from HTML5 https://developer.mozilla.org/en-US/docs/Web/API/AudioTrack
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
String
|
Index of the audio track |
|
enabled |
Boolean
|
True if the audio track is enabled |
|
lang |
String
|
<optional> |
Deprecated. Language associated to the audio track |
language |
String
|
<optional> |
Language associated to the audio track |
tag |
String
|
<optional> |
Deprecated. Label to shown on the UI |
label |
String
|
<optional> |
Label to shown on the UI |