methods\utils\get_participant_media library

Retrieves the media stream of a participant by ID or name.

This function searches for a participant's media stream (video or audio) using either their producer ID or participant name.

Parameters:

  • id (String): The producer ID of the participant. Default is empty string.
  • name (String): The name of the participant. Default is empty string.
  • kind (String): The type of media stream to retrieve:
    • 'video': Video stream
    • 'audio': Audio stream Default is 'video'.
  • parameters (GetParticipantMediaParameters): Parameters containing:
    • allVideoStreams: List of all video streams
    • allAudioStreams: List of all audio streams
    • participants: List of all participants

Returns:

  • Future<MediaStream?>: The media stream if found, otherwise null.

Example:

// Get video stream by producer ID
final videoStream = await getParticipantMedia(
  id: 'producer-id-123',
  name: '',
  kind: 'video',
  parameters: parameters,
);

// Get audio stream by participant name
final audioStream = await getParticipantMedia(
  id: '',
  name: 'John Doe',
  kind: 'audio',
  parameters: parameters,
);

Classes

GetParticipantMediaOptions
Options for the getParticipantMedia function.
GetParticipantMediaParameters
Parameters interface for getParticipantMedia.

Functions

getParticipantMedia(GetParticipantMediaOptions options) Future<MediaStream?>
Retrieves the media stream of a participant by ID or name.

Typedefs

GetParticipantMediaType = Future<MediaStream?> Function(GetParticipantMediaOptions options)
Type definition for the getParticipantMedia function.