Class: Media

Media


new Media(src, successCallback, errorCallback, statusCallback)

This class provides access to the device media, interfaces to both sound and video

Parameters:
Name Type Description
src

The file name or url to play

successCallback

The callback to be called when the file is done playing or recording.
successCallback()

errorCallback

The callback to be called if there is an error.
errorCallback(int errorCode) - OPTIONAL

statusCallback

The callback to be called when media status has changed.
statusCallback(int statusCode) - OPTIONAL

Source:

Methods


<static> onStatus(id, msgType, value)

Audio has status update.
PRIVATE

Parameters:
Name Type Description
id

The media object id (string)

msgType

The 'type' of update this is

value

Use of value is determined by the msgType

Source:

getCurrentAmplitude()

Get amplitude of audio.

Source:

getCurrentPosition()

Get position of audio.

Source:

getDuration()

Get duration of an audio file.
The duration is only set for audio that is playing, paused or stopped.

Source:
Returns:

duration or -1 if not known.


pause()

Pause playing audio file.

Source:

pauseRecord()

Pause recording audio file.

Source:

play()

Start or resume playing audio file.

Source:

release()

Release the resources.

Source:

resumeRecord()

Resume recording audio file.

Source:

seekTo()

Seek or jump to a new time in the track..

Source:

setRate()

Adjust the playback rate.

Source:

setVolume()

Adjust the volume.

Source:

startRecord()

Start recording audio file.

Source:

stop()

Stop playing audio file.

Source:

stopRecord()

Stop recording audio file.

Source: