Media

This is an object to hold and manipulate the media artifact.

Functions
createMedia (src String in, onSuccess MediaSuccess in, onError CordovaErrorHandler in, onStatus MediaStatus in)
Attaches a media artifact to the media object.
src
A URI containing the audio content.
onSuccess
The success callback of MediaSuccess.
onError
The error callback function.
onStatus
The callback that executes to indicate status changes with the status passed in.
getCurrentPosition (onSuccess MediaPosition in, onError CordovaErrorHandler in)
An asynchronous function to get the current position within an audio file and return to the onSuccess callback.
getDuration () returns (int)
Gets the total length of the audio file.
pause()
Pauses playback of the audio file.
play()
Starts or continues to play the audio file.
release()
Releases the audio resources of the underlying operating system.
seekTo(ms int in)
Moves the position within the audio file.
setVolume(volumn float in)
Sets the volume for audio playback.
startRecord()
Starts recording an audio file.
stop()
Stops playing an audio file.
stopRecord()
Stops recording an audio file.