Q audiopicker Class
jQuery plugin that allows to create or upload an audio file to the server. Works on various platforms (desktop and mobile etc) in similar way. Should be applied to element like this $('#someimg').plugin('Q/audio', options).
Constructor
Q audiopicker
-
[options]
Parameters:
-
[options]
Object optionaloptions is an Object that contains parameters for function
-
[url]
String optionalurl is a url to post to.
-
[path="uploads"]
String optionalCan be a URL path or a function returning a URL path. It must exist on the server.
-
[subpath=""]
String | Function optionalA subpath which may be created on the server if it doesn't already exist. If this is a function, it is executed right before the request is sent.
-
[preprocess]
Q.Event optionalpreprocess is a function which is triggering before file upload. Its "this" object will be a jQuery of the audiopicker element The first parameter is a callback, which should be called with an optional hash of overrides, which can include "data", "path", "subpath", "save", "url", "loader"
-
[onSuccess]
Q.Event optionalonSuccess is Q.Event which is called on successful upload. First parameter will be the server response.
-
[onError]
Q.Event optionalonError Q.Event which is called if upload failed.
-
[onFinish]
Q.Event optionalonFinish Q.Event which is called at the end, whatever the outcome.
-
Item Index
Methods
Methods
_process
()
Process file uploading
formatRecordTime
-
time
Format record time elapsed
Parameters:
-
time
IntTime elapsed in seconds
Returns:
formatted string
pauseAudio
Pause audio and detect promise event on mobile devices
()
pick
()
Set the audio
playAudio
Play audio and detect promise event on mobile devices
()
player
()
Audio player
recorderStateChange
-
newState
Handle recorder states
Parameters:
-
newState
StringNew recorder state
remove
()
Removes the Q/audio functionality from the element
start
()
Start audio creation dialog