Class: Participant

Participant

Participant is a human being which is taking part in the conference and communicating with other participants using either an application based on Mind Web/Android/iOS SDK or SIP-enabled software/hardware. A participant on behalf of whom application is interacting with Mind Web SDK is called local, whereas all other participants are considered to be remote (but each of them is local from its point of view).

Participant class is used for representing remote participant and contains a set of methods for getting and setting participant parameters and for getting primary and secondary media streams of the participant:

let participant = conference.getParticipants()[0];

let primaryVideo = document.getElementById("primaryVideo");
let primaryStream = participant.getMediaStream();
primaryVideo.mediaStream = primaryStream;

let secondaryVideo = document.getElementById("secondaryVideo");
let secondaryStream = participant.getSecondaryMediaStream();
secondaryVideo.mediaStream = secondaryStream;

Classes

Participant

Methods

getId() → {String}

Return the ID of the participant. The ID is unique and never changes.

Returns:

The ID of the participant.

Type
String

getLayout() → {ConferenceLayout}

Returns current layout of the participant.

Returns:

The current layout of the participant

Type
ConferenceLayout

getMediaStream() → {MediaStream}

Returns primary media stream of the participant. The primary media stream is intended to be used for streaming participant's video taken from his camera and participant's voice taken from his microphone. The returned stream can be played with a help of <video/> or <audio/> HTML elements (just assign the stream to mediaStream property of the element). The primary media stream is available at any time, even if the participant is not streaming neither primary video nor primary audio at the moment.

Returns:

The primary media stream of the participant.

Type
MediaStream

getName() → {String}

Returns the current name of the participant. The name of the participant is shown above his video in the conference media stream and recording.

Returns:

The current name of the participant

Type
String

getRole() → {ParticipantRole}

Returns the current role of the participant. The role defines a set of operations which the participant can do.

Returns:

The current role of the participant

Type
ParticipantRole

getSecondaryMediaStream() → {MediaStream}

Returns secondary media stream of the participant. The secondary media stream is intended be used for streaming an arbitrary audio/video content, e.g. for sharing a screen of participant's computer. The returned stream can be played with a help of <video/> or <audio/> HTML elements (just assign the stream to mediaStream property of the element). The secondary media stream is available at any time, even if the participant is not streaming neither secondary video nor secondary audio at the moment.

Returns:

The secondary media stream of the participant.

Type
MediaStream

isStreamingAudio() → {Boolean}

Checks whether the participant is at the moment streaming primary audio (i.e. audio taken from his microphone). If both this method and Participant#isStreamingVideo return false then the participant is not at the moment streaming primary media stream to the conference at all.

Returns:

The boolean value which indicates whether the participant is streaming primary media stream with audio or not.

Type
Boolean

isStreamingSecondaryAudio() → {Boolean}

Checks whether the participant is at the moment streaming secondary audio (i.e. an arbitrary content with audio). If both this method and Participant#isStreamingSecondaryVideo return false then the participant is not at the moment streaming secondary media stream to the conference at all.

Returns:

The boolean value which indicates whether the participant is streaming secondary media stream with audio or not.

Type
Boolean

isStreamingSecondaryVideo() → {Boolean}

Checks whether the participant is at the moment streaming secondary video (i.e. an arbitrary content with video). If both this method and Participant#isStreamingSecondaryAudio return false then the participant is not at the moment streaming secondary media stream to the conference at all.

Returns:

The boolean value which indicates whether the participant is streaming secondary media stream with video or not.

Type
Boolean

isStreamingVideo() → {Boolean}

Checks whether the participant is at the moment streaming primary video (i.e. video taken from his camera). If both this method and Participant#isStreamingAudio return false then the participant is not at the moment streaming primary media stream to the conference at all.

Returns:

The boolean value which indicates whether the participant is streaming primary media stream with video or not.

Type
Boolean

setLayout(layout) → {Promise}

Changes the layout of the participant. The layout determines arrangement of videos in conference MediaStream. The local participant can change his layout without any restrictions, whereas the layout of a remote participant can be changed by an application or MODERATOR only. This is an asynchronous operation, that's why this method returns a Promise that resolves when layout changing is completed.

Parameters:
Name Type Description
layout ConferenceLayout

The layout for the participant

Returns:

The promise that resolves when layout changing is completed

Type
Promise

setName(name) → {Promise}

Changes the name of the participant. The name of the participant is shown above his video in the conference media stream and recording. The local participant can change his name without any restrictions, whereas the name of a remote participant can be changed by a MODERATOR only. This is an asynchronous operation, that's why this method returns a Promise that resolves when renaming is completed.

Parameters:
Name Type Description
name String

The new name for the participant

Returns:

The promise that resolves when renaming is completed

Type
Promise

setRole(role) → {Promise}

Changes the role of the participant. The role defines a set of operations which the participant can do. Only a MODERATOR can change the role of any participant. This is an asynchronous operation, that's why this method returns a Promise that resolves when role changing is completed.

Parameters:
Name Type Description
role ParticipantRole

The new role for the participant

Returns:

The promise that resolves when role changing is completed

Type
Promise