How do I call methods on a Camera instance?

You can get your camera's JS instance by accessing it in the CameraTag cameras array once the camera has initialized:
CameraTag.observe(YOUR_CAMERA_ID, "initialized", function(){
myCamera = CameraTag.cameras["YOUR_CAMERA_ID"];
}) 
Note that the CAMERA_ID listed above should match the 'id' attribute of the <camera> tag and not the 'data-app-id' attribute.

Once you have the instance calling methods is as simple as

myCamera.record();

record()

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

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 camera 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 camera 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 <camera> 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 camera. 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 camera is in the readyToRecord state before calling record_without_countdown.

showRecorder()

displays the camera 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 <camera>'s signaure when "require signature for publishing" security setting is truned on.

setSignatureExpiration( expiration_integer )

This can be used to set (or change) the <camera>'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).

selectDevices()

loads the device selection screen and allows the user to select a camera / microphone to use when recording.