Use meeting statuses

View as Markdown

The Zoom Meeting SDK for iOS provides rich listeners for you to monitor and perform actions when some behaviors happen.

Meeting service status

Meeting state

Once the meeting has started or joined, the Meeting SDK will return the meeting state using MobileRTCMeetingServiceDelegate. To listen to the meeting service, implement these methods.

func onMeetingError(_ error: MobileRTCMeetError, message: String?) {
    print("onMeetingError: \(error) messsage: \(message)")
}

func onMeetingStateChange(_ state: MobileRTCMeetingState) { print("onMeetingStateChange: \(state)") }

func onMeetingReady() { print("onMeetingReady") }

func onMeetingEndedReason(_ reason: MobileRTCMeetingEndReason) { print("onMeetingEndedReason: \(reason)") }

Join a meeting

Implement the onJoinMeetingConfirmed method to catch the moment when you successfully join a meeting. There may be instances when joining a meeting requires more information, like a display name or password is missing, or preview confirmation is required. This is when onJoinMeetingInfoRequired will be called.

func onJoinMeetingConfirmed() {
    let meetingNo = MobileRTCInviteHelper.sharedInstance().ongoingMeetingNumber
    print("onJoinMeetingConfirmed MeetingNo: \(meetingNo)")
}

func onJoinMeetingInfoRequired(\_ handler: MobileRTCJoinMeetingInfoHandler) { print("onJoinMeetingInfoRequired: \(handler.info)")

    // Based on the handler.info above, handle it accordingly.
    handler.cancel()
    handler.confirmPreview(screenName: String?, videoOn: Bool, audioOn: Bool)
    handler.inputDisplayName(displayName: String?, password: String?)

}

Catch waiting room status changes

Implement onWaitingRoomStatusChange method to catch status changes in the waiting room.

func onWaitingRoomStatusChange(_ needWaiting: Bool) {
    print("onWaitingRoomStatusChange: \(needWaiting)")
}

Monitor changes during a webinar

When a user tries to join a webinar that requires registration, or when a user is missing their username or email, implement these methods.

func onSinkWebinarNeedRegister(_ registerURL: String) {
    print("onSinkWebinarNeedRegister: \(registerURL)")
}

/_ Callback event that a user joins a webinar which requires username and email. Note - In default UI mode, developer can implement this method to avoid Zoom's default UI from showing _/ func onSinkJoinWebinarNeedUserNameAndEmail(completion: @escaping (String, String, Bool) -> Bool) { print("onSinkJoinWebinarNeedUserNameAndEmail")

    // completion handler: User needs to provide username (first String) and email (second String) to join meeting or cancel (Bool) the join action.
    completion(String, String, Bool)
}

Buttons

These methods are associated with different buttons that help you grab the moment when the button is selected.

func onClickedShareButton(_ parentVC: UIViewController, addShareActionItem array: NSMutableArray) -> Bool {

}

func onClickedAudioButton(\_ parentVC: UIViewController) -> Bool {

}

func onClickedInviteButton(\_ parentVC: UIViewController, addInviteActionItem array: NSMutableArray?) -> Bool {

}

func onClickedParticipantsButton(\_ parentVC: UIViewController) -> Bool {

}

func onClickedDialOut(\_ parentVC: UIViewController, isCallMe me: Bool) {

}

func onClickedEndButton(\_ parentVC: UIViewController, end endButton: UIButton) -> Bool {

}

Get the audio service status

Learn when the meeting audio changes - mute or unmute, or setting the audio type - by implementing these methods.

func onSinkMeetingAudioTypeChange(\_ userID: UInt) {

}

func onSinkMeetingAudioStatusChange(\_ userID: UInt) {

}

func onSinkMeetingAudioStatusChange(\_ userID: UInt, audioStatus: MobileRTC_AudioStatus) {

}

func onSinkMeetingAudioRequestUnmuteByHost() {

}

func onUserNetworkStatusChanged(\_ type: MobileRTCComponentType, level: MobileRTCNetworkQuality, userID: UInt, uplink: Bool) {
    // MobileRTCComponentType can be MobileRTCComponentType_AUDIO here
}

Video service status

Learn the video status in the Meeting SDK - such as starting or stopping preview, muting or pausing, or changing the video status - with any of these multiple listeners.

func onMyVideoStateChange() {

}

func onSinkMeetingActiveVideo(\_ userID: UInt) {

}

func onSinkMeetingPreviewStopped() {

}

func onSinkMeetingVideoStatusChange(\_ userID: UInt) {

}

func onSinkMeetingVideoStatusChange(\_ userID: UInt, videoStatus: MobileRTC_VideoStatus) {

}

func onSinkMeetingVideoRequestUnmute(byHost completion: @escaping (Bool) -> MobileRTCSDKError) {

}

func onUserNetworkStatusChanged(\_ type: MobileRTCComponentType, level: MobileRTCNetworkQuality, userID: UInt, uplink: Bool) {
    // MobileRTCComponentType can be MobileRTCComponentType_VIDEO here
}

User join or leave status

To know when a user joins or leaves the meeting, implement these methods.

func onMyVideoStateChange() {

}

func onSinkMeetingActiveVideo(\_ userID: UInt) {

}

func onSinkMeetingPreviewStopped() {

}

func onSinkMeetingVideoStatusChange(\_ userID: UInt) {

}

func onSinkMeetingVideoStatusChange(\_ userID: UInt, videoStatus: MobileRTC_VideoStatus) {

}

func onSinkMeetingVideoRequestUnmute(byHost completion: @escaping (Bool) -> MobileRTCSDKError) {

}

func onUserNetworkStatusChanged(\_ type: MobileRTCComponentType, level: MobileRTCNetworkQuality, userID: UInt, uplink: Bool) {
  // MobileRTCComponentType can be MobileRTCComponentType_VIDEO here
}

Get the Share service status

Get a notification when meeting participants start sharing.

func onShareContentChanged(\_ shareInfo: MobileRTCSSharingSourceInfo) {

}

func onSinkShareSettingTypeChanged(\_ shareSettingType: MobileRTCShareSettingType) {

}

func onSinkShareSizeChange(\_ userID: UInt) {

}

func onUserNetworkStatusChanged(\_ type: MobileRTCComponentType, level: MobileRTCNetworkQuality, userID: UInt, uplink: Bool) { // MobileRTCComponentType can be MobileRTCComponentType_SHARE here }