Html5Audio Class

The static class that handles HTML5 Audio.

Constructor

Html5Audio ()

Item Index

Methods Properties

Methods

addLoadListener ( listner ) [static]

Add a callback function that will be called when the audio data is loaded.

Parameters:

  • listner Function

    The callback function

clear () [static]

Clears the audio data.

fadeIn ( duration ) [static]

Performs the audio fade-in.

Parameters:

  • duration Number

    Fade-in time in seconds

fadeOut ( duration ) [static]

Performs the audio fade-out.

Parameters:

  • duration Number

    Fade-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 Boolean

    Whether the audio data play in a loop

  • offset Number

    The 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 String

    The 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.