User Tools

Site Tools


example_waitforcamerastate

Example: Wait for camera state change

This script waits until the camera is connected and then starts media recording.

var cameraName = "GoPro Hero 4";

if (GetCameraState("ConnectionState", cameraName) != "connected")
{
    SetCameraFunction("connectToCamera", cameraName, false);
    WaitForCameraState("ConnectionState", "connected", 5000, cameraName);
}

if (GetCameraState("ConnectionState", cameraName) == "connected")
{
    SetCameraFunction("startRecording", cameraName);
}
else
{
    LogText("Something went wrong. The camera is still not connected.");
}
example_waitforcamerastate.txt · Last modified: 2016/09/06 09:01 by act