Front or back camera on start app

I tried getting what direction the camera is facing when the app launches

But I don’t know how to read the current value only how to detect change like this

CameraInfo.captureDevicePosition.monitor().subscribe(function (e) {
    Diagnostics.log("camerainfo handler triggered")
    if (e.newValue == "BACK") {
        frontCamOn = false;
    } else {
        frontCamOn = true;
    }
})

How do I set frontCamOn true or false on app launch?

I totally forgot about the ‘enable for front camera’ checkbox - that was all I needed for my canvas. It’s still a valid question though - how to get the value of a signal on filter launch.

Add {fireOnInitialValue: true} to monitor so you can get the launch value.

6 Likes