Remote camera control

The Video SDK for macOS lets one user request control of another user's camera by panning, tilting, and zooming it remotely. This is useful for remote-assistance, inspection, and remote-monitoring workflows where one participant needs to direct what another participant's camera shows.

The control flow is:

  1. The requester asks for control of a specific user's camera.
  2. If granted, the requester pans, tilts, or zooms the receiver's camera.
  3. The requester releases control when done.

Both users must support the PTZ-compatible camera capabilities for the operations to take effect on the receiver's device.

Request control of a remote camera

Get the remote-control helper from the target ZMVideoSDKUser with getRemoteCameraControlHelper and call requestControlRemoteCamera.

if let helper = targetUser.getRemoteCameraControlHelper() {
    let result = helper.requestControlRemoteCamera()
    // result is ZMVideoSDKErrors_Success on success.
}
ZMVideoSDKRemoteCameraControlHelper *helper = [targetUser getRemoteCameraControlHelper];
ZMVideoSDKErrors result = [helper requestControlRemoteCamera];
// result is ZMVideoSDKErrors_Success on success.

The requester is notified of the outcome via the onCameraControlRequestResult callback on ZMVideoSDKDelegate. For the callback details, see Camera control requests.

Pan, tilt, and zoom

Once control is granted, the requester can move the remote camera using turnLeft, turnRight, turnUp, turnDown, zoomIn, and zoomOut. Each method takes a range parameter between 10 and 100 that controls how far the camera moves per call.

guard let helper = targetUser.getRemoteCameraControlHelper() else { return }
helper.turnLeft(20)
helper.turnRight(20)
helper.turnUp(20)
helper.turnDown(20)
helper.zoomIn(15)
helper.zoomOut(15)
ZMVideoSDKRemoteCameraControlHelper *helper = [targetUser getRemoteCameraControlHelper];
[helper turnLeft:20];
[helper turnRight:20];
[helper turnUp:20];
[helper turnDown:20];
[helper zoomIn:15];
[helper zoomOut:15];

Smaller range values produce finer movement, which makes UI controls (such as press-and-hold arrow buttons) feel responsive without overshooting the target. To control your own PTZ-capable camera instead, see Pan, tilt, and zoom.

Give up control

When the requester is finished, call giveUpControlRemoteCamera to release control of the camera.

targetUser.getRemoteCameraControlHelper()?.giveUpControlRemoteCamera()
[[targetUser getRemoteCameraControlHelper] giveUpControlRemoteCamera];