User Tools

Site Tools


example_waitforcamerastate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

example_waitforcamerastate [2016/09/06 09:01] (current)
act created
Line 1: Line 1:
 +====== Example: Wait for camera state change ======
 +This script waits until the camera is connected and then starts media recording.
 +
 +<​code>​
 +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."​);​
 +}
 +
 +</​code>​
  
example_waitforcamerastate.txt · Last modified: 2016/09/06 09:01 by act