WebAudioPlayer
Constructor Summary
Public Constructor | ||
public |
constructor(options: Object) ITSLanguage WebAudioPlayer non-graphical component. |
Method Summary
Public Methods | ||
public |
Returns ready state of the player. |
|
public |
getAudioVolume(): * |
|
public |
Returns the percentage of which the buffer is filled. |
|
public |
Returns the current playing time as offset in seconds from the start. |
|
public |
Returns the total duration in seconds. |
|
public |
getPlaybackRate(): * |
|
public |
Returns state of the player. |
|
public |
Preload audio from an URL. |
|
public |
pause() Pause playback of audio. |
|
public |
Start or continue playback of audio. |
|
public |
preload() Start preloading audio. |
|
public |
reset() Unload previously loaded audio. |
|
public |
Start playing audio at the given offset. |
|
public |
setAudioVolume(volume: *) |
|
public |
setPlaybackRate(rate: *) |
|
public |
stop() Stop playback of audio. |
Private Methods | ||
private |
|
Public Constructors
Public Methods
public canPlay(): boolean source
Returns ready state of the player.
Return:
boolean | True when player is ready to start loading data or play. False when no audio is loaded or preparing. |
public getCurrentTime(): number source
Returns the current playing time as offset in seconds from the start.
public load(url: string, preload: boolean, loadedCb: Function) source
Preload audio from an URL.
Params:
Name | Type | Attribute | Description |
url | string | The URL that contains the audio. |
|
preload | boolean |
|
Try preloading metadata and possible some audio (default). Set to false to not download anything until playing. |
loadedCb | Function |
|
The callback that is invoked when the duration of the audio file is first known. |
public play(position: number) source
Start or continue playback of audio.
Params:
Name | Type | Attribute | Description |
position | number |
|
When position is given, start playing from this position (seconds). |
public scrub(percentage: number) source
Start playing audio at the given offset.
Params:
Name | Type | Attribute | Description |
percentage | number | Start at this percentage (0..100) of the audio stream. |
public setAudioVolume(volume: *) source
Params:
Name | Type | Attribute | Description |
volume | * |
public setPlaybackRate(rate: *) source
Params:
Name | Type | Attribute | Description |
rate | * |