The SetCameraFunction
function calls a standard camera function.
functionName
: The function name (possible function names see below).cameraName
: The camera name of the camera on which the function should be executed. If left empty, then the first connected camera is taken.waitUntilFinished
: If true then the function blocks until the camera returns the function result. If false, then the function immediately returns.connectToCamera
: Connects the app to the camera. Note: the camera must be connected with the device over Wifi before calling this function.disconnectFromCamera
: Disconnects the app from the camera.startRecording
: Starts recording.stopRecording
: Stops recording.toggleRecording
: Toggles recording.powerCameraOn
: Powers the camera on.powerCameraOff
: Turns the camera off.toggleCameraPower
: Toggles the camera power.turnPreviewOn
: Turns the preview on.turnPreviewOff
: Turns the preview off.startPreviewDecoding
: Starts preview decoding.stopPreviewDecoding
: Stops preview decoding.togglePreviewDecoding
: Toggles preview decoding.tagMoment
: Tags the moment.cancelMediaDownloads
: Cancels all media downloads.startCameraStatusUpdates
: Starts camera updates. stopCameraStatusUpdates
: Stops camera updates.requestSingleCameraStatusUpdate
: Requests a single camera status update.bool: SetCameraFunction(string functionName[, string cameraName=\"\", bool waitUntilFinished=true])
var result = SetCameraFunction(); // result: false var result = SetCameraFunction('connectToCamera'); // result: false var result = SetCameraFunction('disconnectFromCamera'); // result: true. Disconnects from the first connected camera in the list. var result = SetCameraFunction('connectToCamera', 'GoPro Hero 4'); // waits until the camera is connected and returns true on success var result = SetCameraFunction('connectToCamera', 'GoPro Hero 4', false); // starts connecting to the camera and immediately returns without // waiting for the camera to finish connecting.