Skip to main content
Version: 0.0.x

Meeting Class Event Handler - Python

Overview

MeetingEventHandler is a base class for event handlers. Event handlers are used to handle events from the meeting, such as when a participant joins or leaves the meeting, when the active speaker changes, or other various meeting-related events.

Refer to the Example section and modify MyMeetingEventHandler based on your requirements.

Events

The base class MeetingEventHandler has the following events associated with it:

on_meeting_joined

  • Event emitted when a participant (local participant) joins the meeting. This indicates that the meeting has been successfully joined.
  • Parameters:
    • data: None

on_meeting_left

  • Event emitted when a participant leaves the meeting.
  • Parameters:
    • data: None

on_participant_joined

  • Event emitted when a new participant joins the meeting.
  • Parameters:

on_participant_left

  • Event emitted when a participant leaves the meeting.
  • Parameters:

on_speaker_changed

  • Event emitted when the active speaker changes in the meeting.
  • Parameters:
    • data: participantId of the new active speaker.

on_recording_state_changed

  • Event emitted when the recording state of the meeting changes.
  • Parameters:
    • data: Information about the new recording state.

on_recording_started

  • Event emitted when the recording of the meeting starts.
  • Parameters:
    • data: Information about the recording start.

on_recording_stopped

  • Event emitted when the recording of the meeting stops.
  • Parameters:
    • data: Information about the recording stop.

on_mic_requested

  • Event emitted when a microphone is requested.
  • Parameters:
    • data: Information about the microphone request.

on_webcam_requested

  • Event emitted when a webcam is requested.
  • Parameters:
    • data: Information about the webcam request.

on_meeting_state_change

  • Event emitted when the state of the meeting changes.
  • Parameters:
    • data: Information about the new meeting state.

on_transcription_state_changed

  • Event emitted when the transcription state of the meeting changes.
  • Parameters:
    • data: Information about the new transcription state.

on_transcription_text

  • Event emitted when new transcription text is available.
  • Parameters:
    • data: The transcription text.

on_error

  • Event emitted when any type of error occurred.
  • Parameters:
    • data: str

Example

from videosdk import MeetingEventHandler

class MyMeetingEventHandler(MeetingEventHandler):
def __init__(self):
super().__init__()

def on_participant_joined(self, data):
# Custom logic when a participant joins
print("Participant joined")
pass

def on_participant_left(self, data):
# Custom logic when a participant leaves
print("Participant left")
pass

# Additional event callbacks as needed

# Pass MyMeetingEventHandler instance to the meeting
meeting.add_event_listener(MyMeetingEventHandler())

Got a Question? Ask us on discord