Note that the MICROPHONE_ID listed above should match the 'id' attribute of the <microphone> tag and not the 'data-app-id' attribute.

Once you have the instance calling methods is as simple as

myMicrophone.record();

record()

Starts the recording process (preroll + recording). You should make sure that the microphone is in the readyToRecord state before calling record.

pauseRecording()

Pauses recording.

resumeRecording()

Started recording after a pause (will not work after recording is stopped)

play()

Starts playback of recorded video

stopPlayback()

Stops playback

stopRecording()

Starts the recording process (preroll + recording)

publish()

published the currently recorded video. You should make sure the microphone is in the readyToPublish state before calling publish.

getState()

gets the current state of the recorder- returns one of:

initialized

recording

readyToPublish

publishing

published

processed

getVideo()

Returns a JS Object containing information about the video to be recorded. This object will contain the video UUID, recording formats, and (once the microphone is in the published state) video and thumbnail URLs

setMetadata( js_object )

Allows you to pass arbitrary data to be stored with your video on our server. This data will be returned as part of the video object in the REST API and server callbacks.

reset()

re-initializes the player to record a new video to the server. Once you call this method you
must wait for the "cameraReset" event before attempting to use <microphone> or JS API again.

destroy()

removes the camera and it's associated assets / references from the DOM

connect()

opens connection to the server and starts microphone. Unless you're doing something fancy custom you should probably be using the record() method which will connect automatically for you.

record_without_countdown()

starts recording immediatly (make sure you're connected). Unless you're doing something fancy custom you should probably be using the record() method. You should make sure the microphone is in the readyToRecord state before calling record_without_countdown.

showRecorder()

displays the microphone stream in the swf. Unless you're doing something fancy custom you should probably be using the record() method.

showPlayer()

displays the playback stream in the swf. Unless you're doing something fancy custom you should probably be using the play() method.

setMaxLength( seconds )

sets the maximum recording length. Helpful if you need to change recording lengths after calling reset()

setSignature( signature_string )

This can be used to set (or change) the <microphone>'s signaure when "require signature for publishing" security setting is truned on.

setSignatureExpiration( expiration_integer )

This can be used to set (or change) the <microphone>'s signaure expiration when "require signature for publishing" security setting is truned on.

setMinLength( seconds )

sets the minimum recording length. Helpful if you need to change recording lengths after calling reset()

startUpload()

manually triggers the selected file to start uploading (used in conjunction with data-upload-on-seekect).

restartUpload()

restarts a file upload. can be used in the case of a stalled upload due to network issues.