Skip to main content
Version: 0.0.x

Participant Class Methods - Python

enable_webcam

  • enable_webcam() is used to enable participant's camera.

Events associated with enable_webcam() :

  • First the participant will get a callback on on_webcam_requested and once the participant accepts the request, webcam will be enabled.

  • Every Participant will receive a on_stream_enabled event with stream object.

Returns

  • void

disable_webcam

  • disable_webcam() is used to disable participant camera.

Events associated with disable_webcam() :

  • Every Participant will receive a on_stream_disabled event with stream object.

Returns

  • void

enable_mic

  • enable_mic() is used to enable participant microphone.

Events associated with enable_mic() :

  • First the participant will get a callback on on_mic_requested and once the participant accepts the request, mic will be enabled.

  • Every Participant will receive a on_stream_enabled event with stream object.

Returns

  • void

disable_mic

  • disable_mic() is used to disable participant microphone.

Events associated with disable_mic():

  • Every Participant will receive a on_stream_disabled event with stream object.

Returns

  • void

remove

  • It is used to remove a participant from the meeting

capture_image

  • It is used to capture image of the participant's current videoStream.

  • It will return image in a form of PIL Image.

Parameters

  • filepath: The path to the file in str
  • desr_height: number
  • desr_weight: number

async_capture_image

  • It is used to capture image of the participant's current videoStream asynchronously.

  • it returns the image as a base64 encoded str.

Parameters

  • filepath: The path to the file in str
  • desr_height: number
  • desr_weight: number

Returns

  • PIL Image: In version 0.0.2, it returns an image in the form of a PIL Image.
  • base64: In version 0.0.3 and later, it returns the image as a base64 encoded str.

Example

# For version 0.0.2
from PIL import Image

image = await participant.async_capture_image(filepath="path/to/file", desr_height=720, desr_weight=1280)
image.show()

# For version 0.0.3
base64_image = await participant.async_capture_image(filepath="path/to/file", desr_height=720, desr_weight=1280)
print(base64_image)

add_event_listener

  • It is used to add event listener for the participant.

Parameters

Returns

  • void

Example

from videosdk import ParticipantEventHandler

class MyParticipantEventHandler(ParticipantEventHandler):
pass

participant_event_handler = MyParticipantEventHandler()
participant.add_event_listener(participant_event_handler)

remove_event_listener

  • It is used to remove event listener for the participant.

Parameters

Returns

  • void

Example

from videosdk import ParticipantEventHandler

class MyParticipantEventHandler(ParticipantEventHandler):
pass

participant_event_handler = MyParticipantEventHandler()
participant.remove_event_listener(participant_event_handler)

remove_all_listeners

  • It is used to remove all event listener from the participant.

Returns

  • void

Example

participant.remove_all_listeners()

Got a Question? Ask us on discord