Callback Delegate

Listening to the meet events#

In order to listen to the meet events you need to set delegate to the CallManagerDelegate sdk using the below method

CallManager.delegate = self
    func onMuteStatusUpdated(muteEvent: MuteEvent, userId: String)
    func onCallStatusUpdated(callStatus: CALLSTATUS, userId: String)
    func onCallAction(callAction: CallAction, userId: String)
    func onUserSpeaking(userId: String, audioLevel: Int)
    func onUserStoppedSpeaking(userId: String)
    func onLocalVideoTrackAdded(userId : String, videoTrack: RTCVideoTrack)
    func onRemoteVideoTrackAdded(userId : String, track: RTCVideoTrack)
    func socketConnectionEstablished()
    func getGroupName(_ groupId : String)
    func getDisplayName(IncomingUser : [String], incomingUserName: String, metaData : [CallMetadata]) -> [String]
    info

    AudioLevel ranges from 0 to 10, 0 being very low sound and 10 being too loud.

    Handling mute events#

    Whenever a meet user mute/unmute their video or audio, the below delegate will be triggered.

      func onMuteStatusUpdated(muteEvent: MuteEvent, userJid: String) {
      switch muteEvent {
      case .ACTION_REMOTE_AUDIO_MUTE:
      break
      case .ACTION_REMOTE_AUDIO_UN_MUTE:
      break
      case .ACTION_REMOTE_VIDEO_MUTE:
      break
      case .ACTION_REMOTE_VIDEO_UN_MUTE:
      break
      case .ACTION_LOCAL_AUDIO_MUTE:
      break
      case ACTION_LOCAL_AUDIO_UN_MUTE:
      break
      }

      muteEvent value will be anyone of the values of annotation class MuteEvent.

      muteEvent ValueMeet event
      MuteEvent.ACTION_REMOTE_VIDEO_MUTEwhen the remote user muted his video
      MuteEvent.ACTION_REMOTE_VIDEO_UN_MUTEwhen the remote user unmuted his video
      MuteEvent.ACTION_REMOTE_AUDIO_MUTEwhen the remote user muted his audio
      MuteEvent.ACTION_REMOTE_AUDIO_UN_MUTEwhen the remote user unmuted his video
      MuteEvent.ACTION_LOCAL_AUDIO_MUTEwhen the local user muted his audio
      MuteEvent.ACTION_LOCAL_AUDIO_UN_MUTEwhen the local user unmuted his video

      Handling meet status#

      Whenever call status changed during meet, the below delegate will be triggered.

        func onCallStatusUpdated(callStatus: CALLSTATUS, userId: String) {
        }

        callStatus value will be anyone of the values of annotation class CallStatus.

        callStatus ValueMeet event
        CallStatus.CONNECTINGThe current meet is in connecting state
        CallStatus.ATTENDEDthe user attended meet and UI can be presented with the users in the meet
        CallStatus.CONNECTEDthe meet is successfully connected and audio/video tracks transmission is about to start
        CallStatus.DISCONNECTEDthe meet is disconnected and meet UI can be closed
        CallStatus.RECONNECTINGthe meet is in reconnecting state
        CallStatus.RECONNECTEDthe meet is connected back after a reconnecting state
        CallStatus.ON_HOLDthe remote user has put the meet on hold, it will happedn when the remote user attended gsm call
        CallStatus.ON_RESUMEthe remote user has resumed the meet after a on hold, it will happen when the remote user disconnected gsm call
        CallStatus.USER_JOINEDUser joined the meet
        CallStatus.USER_LEFTUser left the meet

        Handling meet action#

        Whenever a meet action is received, the below delegate will be triggered,

          func onCallAction(callAction: CallAction, userId: String) {
          }

          callAction value will be anyone of the values of annotation class CallAction.

          callAction ValueMeet event
          CallAction.ACTION_LOCAL_HANGUPwhenever you disconnect the meet, the action will be received
          CallAction.ACTION_REMOTE_VIDEO_ADDEDWhen the remote user video track is received, this action will be received

          Handling the video track events#

          When the remote user video track is received, this action will be received: CallAction.ACTION_REMOTE_VIDEO_ADDED. When this action is triggered, request SDK to fetch the track of the user

            CallManager.getRemoteVideoTrack(jid: USER_JID)