Class: Me

Me

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).

Me class used for representing local participant. Actually Me is a subclass of Participant class, so that it inherits all public methods of the superclass and adds methods for setting primary and secondary media streams to be streamed on behalf of the participant:

let me = conference.getMe();
let microphone = MindSDK.getMicrophones()[0];
let camera = MindSDK.getCameras()[0];
let myStream = MindSDK.createMediaStream(microphone, camera);
me.setMediaStream(myStream);
Promise.all([ microphone.acquire(), camera.acquire() ]).catch(function(error) {
    alert("Can't acquire camera or microphone: " + error);
});

let screen = MindSDK.getScreen();
if (screen) {
    let mySecondaryStream = MindSDK.createMediaStream(null, screen);
    me.setSecondaryMediaStream(mySecondaryStream);
    screen.acquire().catch(function(error) {
        alert("Can't acquire screen: " + error);
    });
}

Classes

Me

Methods

sendMessageToAll(message) → {Promise}

Sends a text message to all in the conference, i.e. to the application and to all participants at once.

Parameters:
Name Type Description
message String

The text of the message.

Returns:

The promise that resolves when sending is completed.

Type
Promise

sendMessageToApplication(message) → {Promise}

Sends a text message to the application.

Parameters:
Name Type Description
message String

The text of the message.

Returns:

The promise that resolves when sending is completed.

Type
Promise

sendMessageToParticipant(message, participant) → {Promise}

Sends a text message to a participant.

Parameters:
Name Type Description
message String

The text of the message.

participant Participant

The participant which the message should be sent to.

Returns:

The promise that resolves when sending is completed.

Type
Promise

setMediaStream(stream)

Sets primary media stream for streaming on behalf of the participant. The primary media stream is intended for streaming video and voice taken from camera and microphone, respectively. If primary media stream is already set, then it will replaced with the passed one. Setting null stops streaming.

Parameters:
Name Type Description
stream MediaStream

The media stream for streaming on behalf of the participant as primary media stream.

setSecondaryMediaStream(stream)

Sets secondary media stream for streaming on behalf of the participant. The secondary media stream is intended for streaming an arbitrary audio/video content (e.g. for sharing a screen or window). If secondary media stream is already set, then it will replaced with the passed one. Setting null stops streaming.

Parameters:
Name Type Description
stream MediaStream

The media stream for streaming on behalf of the participant as secondary media stream.