Skip to main content
Version: 2.0.x

Meeting Class Events - iOS


onMeetingJoined

  • This event will be emitted when a localParticipant successfully joined the meeting.

Example

meeting.listeners.onMeetingJoined();

onMeetingLeft

Example

meeting.listeners.onMeetingLeft();

onParticipantJoined

  • This event will be emitted when a new participant joined the meeting.

Event callback parameters

Example

meeting.listeners.onParticipantJoined(participant);

onParticipantLeft

  • This event will be emitted when a joined participant left the meeting.

Event callback parameters

Example

meeting.listeners.onParticipantLeft(participant);

onSpeakerChanged

  • This event will be emitted when a active speaker changed.
  • If you want to know which participant is actively speaking, then this event will be used.
  • If no participant is actively speaking, then this event will pass null as en event callback parameter.

Event callback parameters

  • participantId: String?

Example

meeting.listeners.onSpeackerChanged(participantId: participantId)

onMicRequested

  • This event will be emitted to the participant B when any other participant A requests to enable mic of participant B.
  • On accepting the request, mic of participant B will be enabled.

Event callback parameters

  • participantId: String?
  • accept: Closure
  • reject: Closure

Example

meeting.listeners.onMicRequested(participantId: participantId) {
// request accepted
} reject: {
// request rejected
}

onWebcamRequested

  • This event will be emitted to the participant B when any other participant A requests to enable webcam of participant B.
  • On accepting the request, webcam of participant B will be enabled.

Event callback parameters

  • participantId: String?
  • accept: Closure
  • reject: Closure

Example

meeting.listeners.onWebcamRequested(participantId: participantId) {
// request accepted
} reject: {
// request rejected
}

onRecordingStateChanged()

  • This event will be emitted when the meeting's recording status changed.

Example


meeting.listeners.onRecordingStateChanged(state: RecordingState) {
switch(state) {
case .RECORDING_STARTING:
print("recording starting")

case .RECORDING_STARTED:
print("recording started")

case .RECORDING_STOPPING:
print("recording stoping")

case .RECORDING_STOPPED:
print("recording stopped")
}
}


onRecordingStarted

  • This event will be emitted when recording of the meeting is started.

Example

meeting.listeners.onRecordingStarted();

onRecordingStopped

  • This event will be emitted when recording of the meeting is stopped.

Example

meeting.listeners.onRecordingStopped();

onLivestreamStateChanged()

  • This event will be emitted when the meeting's livestream status changed.

Example


meeting.listeners.onLivestreamStateChanged(state: LiveStreamState) {
switch(state) {
case .LIVESTREAM_STARTING:
print("livestream starting")

case .LIVESTREAM_STARTED:
print("livestream started")

case .LIVESTREAM_STOPPING:
print("livestream stoping")

case .LIVESTREAM_STOPPED:
print("livestream stopped")
}
}


onLivestreamStarted

  • This event will be emitted when RTMP live stream of the meeting is started.

Example

meeting.listeners.onLivestreamStarted();

onLivestreamStopped

  • This event will be emitted when RTMP live stream of the meeting is stopped.

Example

meeting.listeners.onLivestreamStopped();

onHlsStateChanged()

  • This event will be emitted when the meeting's HLS(Http Livestreaming) status changed.

Example


meeting.listeners.onHlsStateChanged(state: HLSState, hlsUrl: HLSUrl?) {
switch(state) {
case .HLS_STARTING:
print("HLS Starting")

case .HLS_STARTED:
self.hlsStreamStarted = true
print("HLS Started")

case .HLS_PLAYABLE:
print("HLS Playable")

case .HLS_STOPPING:
print("HLS Stopping")

case .HLS_STOPPED:
self.hlsStreamStarted = false
print("HLS Stopped")
}
}


onMeetingStateChanged()

  • This event will be triggered when state of meeting changes.
  • It will pass state as an event callback parameter which will indicate current state of the meeting.
  • All available states are CONNECTING, CONNECTED, CLOSING, CLOSED and CANCELLED.

Event callback parameters

  • data: { meetingState: MeetingState }
    • meetingState: MeetingState

Example


meeting.listeners.onMeetingStateChanged(meetingState: MeetingState) {
switch meetingState {
case .CONNECTING:
print("Meeting is connecting")

case .CONNECTED:
print("Meeting is connected")

case .CLOSING:
print("Meeting is closing")

case .CLOSED:
print("Meeting connection closed")

case .CANCELLED:
print("Meeting is cancelled")
}
}


onError()

  • This event will be triggered when any error occured.
  • It will pass error as an event parameter.
  • To see all available error codes from SDK. Meeting Error Codes

Example

meeting.listeners.onError(error: VideoSDKError) {
switch error {
case .INVALID_TOKEN: print("Invalid Token")

case .INVALID_MEETING_ID: print("Invalid Meeting Id")

case .INVALID_API_KEY: print("Invalid API Key")

case .INVALID_PERMISSIONS: print("Invalid Permissions")

...
}
}


onPinStateChanged()

  • This event will be triggered when participant pin state changes.
  • It will pass participantId, pinType as an event parameter.
  • All available pin states are SHARE_AND_CAM, CAM and SHARE.

Event parameters

  • data: { participantId: String, pinType: PinType }
    • participantId: String
    • pinType: PinType

Example

meeting.listeners.onPinStateChanged(participantId: String, pinType: PinType) {
...
}


onParticipantModeChanged()

  • This event will be triggered when participant mode changes.
  • It will pass participantId, mode as an event parameter.
  • All available participant modes are CONFERENCE and VIEWER.

Event parameters

  • data: { participantId: String, mode: Mode }
    • participantId: String
    • mode: Mode

Example

meeting.listeners.onParticipantModeChanged(participantId: String, mode: Mode) {
...
}

Got a Question? Ask us on discord