Share directly to a Zoom Room

View as Markdown

The SDK lets you share directly to a Zoom Room device through a few method calls.

guard let directShareService = MobileRTC.shared().getDirectShareService() else { return }
if directShareService.canStartDirectShare() {
    directShareService.startDirectShare()
}

Conform to the MobileRTCDirectShareServiceDelegate to receive the direct share status callback.

guard let directShareService = MobileRTC.shared().getDirectShareService() else { return }
directShareService.delegate = self

extension ViewController: MobileRTCDirectShareServiceDelegate {
    func onDirectShareStatusUpdate(_ status: MobileRTCDirectShareStatus, handler: MobileRTCDirectShareViaMeetingIDOrPairingCodeHandler?) {
        if status == .need_MeetingID_Or_PairingCode {
            handler?.try(withMeetingNumber: "MEETING_NUMBER") // Join using meeting_number, OR
            handler?.try(withPairingCode: "PAIRING_CODE") // Join using pairing_code
        }
    }
}

Before stopping a direct share session, confirm that a share is already in progress.

if directShareService.isDirectShareInProgress() {
    directShareService.stopDirectShare()
}