PTZ, Wake-up and Bitrate

Pre-requisite: The user has to be signed in to perform the following operations.


Operate PTZ of the Device

To move the PTZ of the device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
  • request (required): The request object containing the PTZ movement information.
Factory.deviceService.movePtz(spaceId: String, deviceId: String, request: MovePtzRequest) -> IVPublisher<Void>

Stop PTZ Movement

To stop the PTZ movement of the device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
Factory.deviceService.stopPtz(spaceId: String, deviceId: String) -> IVPublisher<Void>

Reset PTZ to default position

To reset the PTZ of the device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
Factory.deviceService.resetPtz(spaceId: String, deviceId: String) -> IVPublisher<Void>

Wake Up Device from sleep state

To wake up the device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
  • request (required): WakeUpRequest(reason:) — a reason string recorded against the device, e.g. "ChangeSettings" or "LiveViewStart".
Factory.deviceService.wakeup(spaceId: String, deviceId: String, request: WakeUpRequest) -> IVPublisher<Void>

Wake Up the Device and send a follow up request

To wake the device and deliver a follow up payload in the same round trip, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
  • wakeUpRequest (required): The request object containing the reason for the wake up.
  • request (optional): The payload to be delivered once the device is awake.
Factory.deviceService.wakeupDevice(spaceId: String, deviceId: String, wakeUpRequest: WakeUpRequest, request: Codable?) -> IVPublisher<Codable?>

Set the Device Bitrate

To set the streaming bitrate of the device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • deviceId (required): The device ID.
  • request (required): The request object containing the bitrate. BitrateRequest(bitrate:) takes the raw value: Bitrate.auto.rawValue ("Auto") or Bitrate.hd.rawValue ("HD").
Factory.deviceService.setDeviceBitrate(spaceId: String, deviceId: String, request: BitrateRequest) -> IVPublisher<Void>

The lullaby player is controlled through the same service; it is documented with the Baby product under Lullaby.