Share directly to a Zoom Room

View as Markdown

Share to a Zoom Room device

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

val directShareService = ZoomSDK.getInstance().preMeetingService.directShareService
if (directShareService.canStartDirectShare()) {
    directShareService.startDirectShare()
}

Receive direct share status updates

Set the IDirectShareServiceHelperEvent to receive the direct share status updates.

val directShareEvent =
    IDirectShareServiceHelperEvent { directShareStatus, iDirectShareViaMeetingIDOrPairingCodeHandler ->
        if (directShareStatus == DirectShareStatus.DirectShare_Need_MeetingID_Or_PairingCode) {
            if (directShareWithMeetingId) {
                iDirectShareViaMeetingIDOrPairingCodeHandler.tryWithMeetingNumber(123456789)
            } else {
                iDirectShareViaMeetingIDOrPairingCodeHandler.tryWithPairingCode("123456")
            }
        }
    }
directShareService.setEvent(directShareEvent)

Stop sharing

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

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