Meeting Class Events - iOS
onMeetingJoined
- This event will be emitted when a localParticipant successfully joined the meeting.
Example
meeting.listeners.onMeetingJoined();
onMeetingLeft
- This event will be emitted when a localParticipant left the meeting.
Example
meeting.listeners.onMeetingLeft();
onParticipantJoined
- This event will be emitted when a new participant joined the meeting.
Event callback parameters
- participant: Participant
Example
meeting.listeners.onParticipantJoined(participant);
onParticipantLeft
- This event will be emitted when a joined participant left the meeting.
Event callback parameters
- participant: Participant
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 participantA
requests to enable mic of participantB
. - 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 participantA
requests to enable webcam of participantB
. - 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")
}
}
onTranscriptionStateChanged()
- This event will be emitted when the meeting's transcription status is changed.
- All available TranscriptionStates are
TRANSCRIPTION_STARTING
,TRANSCRIPTION_STARTED
,TRANSCRIPTION_STOPPING
,TRANSCRIPTION_STOPPED
.
Example
meeting.listeners.onTranscriptionStateChanged(state: TranscriptionState) {
switch(state) {
case .TRANSCRIPTION_STARTING:
print("transcription starting")
case .TRANSCRIPTION_STARTED:
print("transcription started")
case .TRANSCRIPTION_STOPPING:
print("transcription stopping")
case .TRANSCRIPTION_STOPPED:
print("transcription stopped")
}
}
onTranscriptionText()
- This event will be emitted when the transcription is received by the SDK.
Event callback parameters
- data: { _ data: TranscriptionText }
- TranscriptionText.participantId: String
- TranscriptionText.participantName: String
- TranscriptionText.text: String
- TranscriptionText.timestamp: Int
- TranscriptionText.type: String
Example
meeting.listeners.onTranscriptionText(_ data: TranscriptionText) {
print("transcription text: ", data.text)
print("participant name", data.participantName)
}
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
andCANCELLED
.
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
andSHARE
.
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
andVIEWER
.
Event parameters
- data: { participantId: String, mode: Mode }
- participantId: String
- mode: Mode
Example
meeting.listeners.onParticipantModeChanged(participantId: String, mode: Mode) {
...
}
onMicChanged
- This event will be emitted when a localParticipant change their audio output device using
changeMic
method.
Example
meeting.listeners.onMicChanged();
Got a Question? Ask us on discord