AudioProvider Class
Base class for audio providers
Methods
add
-
audioTrack
Adds an existing IAudioTrack instance to the array of managed tracks.
Parameters:
-
audioTrack
IAudioTrackAn instance of IAudioTrack
create
-
track
Creates an IAudioTrack instance from a JSON object. Not implemented in base class.
Parameters:
-
track
ITrackConstraintA JSON object containing at least a src property
Returns:
null
factory
()
IAudioProvider
static
Creates an audio provider based on the environment. If running from within a browser, then defaults to HTML5 Audio. If running on a device, it will check for Cordova and Media plugins and use a native audio player, otherwise falls back to HTML5 audio.
Returns:
An IAudioProvider instance
pause
-
[index]
Pauses a given track.
Parameters:
-
[index]
Number optionalThe track id, or if undefined it will pause whichever track currently playing
play
-
index
Plays a given track.
Parameters:
-
index
NumberThe track id
stop
-
[index]
Stops a given track.
Parameters:
-
[index]
Number optionalThe track id, or if undefined it will stop whichever track currently playing
Properties
current
Number
Gets current track id
current
Unknown
Sets current track id
tracks
IAudioTrack
Gets an array of tracks managed by this provider