Participant class

Someone in the room — you, as Room.localParticipant, or anyone else, in Room.participants.

It carries who they are (id, displayName, metaData), their streams, and the actions you can take on them. On a remote participant, enableMic and enableCam send a request they must accept, while setQuality and pin change only what you receive.

Follow participants and their media with events on the room, such as Events.participantJoined and Events.streamEnabled.

Example

room.on(Events.participantJoined, (Participant participant) {
  print('${participant.displayName} joined');
});

final video = participant.streams.values
    .where((stream) => stream.kind == MediaType.VIDEO)
    .firstOrNull;
Implementers

Properties

displayName ↔ String
The display name of the participant who has joined the room.
getter/setter pair
id ↔ String
The unique identifier of the participant who has joined the room.
getter/setter pair
isLocal ↔ bool
Indicates whether this participant is the local participant.
getter/setter pair
metaData ↔ Map<String, dynamic>?
Additional metadata associated with the participant.
getter/setter pair
mode ↔ Mode
The participant's current mode.
getter/setter pair
pinState ↔ ParticipantPinState
Represents the current pin state of the participant.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
streams ↔ Map<String, RTCStream>
The participant's streams — audio, video and screen share — keyed by stream id, not by kind.
getter/setter pair
videoQuality → VideoQuality?
The quality requested for this participant with setQuality, or null if none was set.
no setter

Methods

captureImage({int? width, int? height, CaptureFlash flash = CaptureFlash.OFF}) → Future<String?>
Captures an image from the local participant’s current video stream.
consumeMicStreams() → Future<void>
Starts consuming (subscribing to) this participant’s microphone (audio) streams.
consumeWebcamStreams() → Future<void>
Starts consuming (subscribing to) this participant’s webcam (video) streams.
disableCam() → Future<void>
Disables the participant’s camera.
disableMic() → Future<void>
Disables the participant’s microphone.
enableCam() → Future<void>
Enables the participant’s camera.
enableMic() → Future<void>
Enables the participant’s microphone.
getAudioStats() → List?
Retrieves real-time audio statistics for the participant.
getShareAudioStats() → Future<List?>
Retrieves statistics for the audio riding along with the participant’s screen share.
getShareStats() → List?
Retrieves real-time screen-share statistics for the participant.
getTransportStats() → Future<Map<String, dynamic>?>
Retrieves ICE/DTLS transport statistics for the participant.
getVideoStats() → List?
Retrieves real-time video statistics for the participant.
isAgent() → bool
Whether this participant is an AI agent: true only for an AgentParticipant.
off(Events event, Function handler) → void
Removes a previously registered listener for a participant-related event.
on(Events event, Function handler) → void
Registers an event listener for participant-related events.
pin([PinType pinType = PinType.SHARE_AND_CAM]) → Future<void>
Pins the participant’s media streams.
remove() → Future<void>
Removes the participant from the room.
removeAllEventListeners() → void
Removes every handler added with on.
setQuality(VideoQuality quality) → Future<void>
Chooses the quality at which you receive this participant's video.
setScreenShareQuality(VideoQuality quality) → Future<void>
Sets the quality of the participant’s screen-share stream.
setViewPort(dynamic width, dynamic height) → Future<void>
Sets the video quality of the participant’s video stream based on the specified viewport dimensions.
stopConsumingMicStreams() → Future<void>
Stops consuming (unsubscribing from) this participant’s microphone (audio) streams.
stopConsumingWebcamStreams() → Future<void>
Stops consuming (unsubscribing from) this participant’s webcam (video) streams.
unpin([PinType pinType = PinType.SHARE_AND_CAM]) → Future<void>
Unpins the participant’s media streams.