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.

if let directShareHelper = ZoomSDK.shared().getPremeetingService()?.getDirectShareHelper() {
    if directShareHelper.canDirectShare() == ZoomSDKError_Success {
        directShareHelper.startDirectShare()
    }
}

Set the ZoomSDKDirectShareHelperDelegate to receive the direct share status updates.

directShareHelper.delegate = self

extension ViewController: ZoomSDKDirectShareHelperDelegate {
    func onDirectShareStatusReceived(_ status: DirectShareStatus, directShareReceived handler: ZoomSDKDirectShareHandler?) {
        if (status == DirectShareStatus_NeedMeetingIDOrSharingKey) {
            handler?.inputMeetingNumber("Meeting_Number") // Join using meeting_number, or
            handler?.inputSharingKey("Sharing_Key") // Join using sharing_key
        }
    }
}

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

if status == DirectShareStatus_InProgress {
    directShareHelper.stopDirectShare()
}