Html5Audio Class
The static class that handles HTML5 Audio.
Constructor
Html5Audio ()
Item Index
Methods PropertiesMethods
addLoadListener ( listner ) [static]
Add a callback function that will be called when the audio data is loaded.
Parameters:
-
listner
FunctionThe callback function
clear () [static]
Clears the audio data.
fadeIn ( duration ) [static]
Performs the audio fade-in.
Parameters:
-
duration
NumberFade-in time in seconds
fadeOut ( duration ) [static]
Performs the audio fade-out.
Parameters:
-
duration
NumberFade-out time in seconds
initialize () Boolean [static]
Initializes the audio system.
Returns:
Boolean:
True if the audio system is available
isError () Boolean [static]
Checks whether a loading error has occurred.
Returns:
Boolean:
True if a loading error has occurred
isPlaying () Boolean [static]
Checks whether the audio is playing.
Returns:
Boolean:
True if the audio is playing
isReady () Boolean [static]
Checks whether the audio data is ready to play.
Returns:
Boolean:
True if the audio data is ready to play
play ( loop , offset ) [static]
Plays the audio.
Parameters:
-
loop
BooleanWhether the audio data play in a loop
-
offset
NumberThe start position to play in seconds
seek () [static]
Gets the seek position of the audio.
setup ( url ) [static]
Sets up the Html5 Audio.
Parameters:
-
url
StringThe url of the audio file
stop () [static]
Stops the audio.
Properties
url String
[read-only] The url of the audio file.
volume Number
The volume of the audio.