Class: Member

Member


new Member(conversation, params)

An individual user (i.e. conversation member).

Parameters:
Name Type Description
conversation Conversation
params object
Source:

Methods


earmuff(earmuff)

Earmuff yourself in the Conversation.

Parameters:
Name Type Description
earmuff boolean

true or false

Source:
Returns:
Type
Promise
Example

Disables your Member from hearing other Members in the Conversation.

// Earmuff yourself
conversation.me.earmuff(true);

// Unearmuff yourself
conversation.me.earmuff(false);

<async> kick(reason)

Kick a Member from the Conversation.

Parameters:
Name Type Argument Description
reason object <optional>

the reason for kicking out a member

Properties
Name Type Argument Description
reason_code string <optional>

the code of the reason

reason_text string <optional>

the description of the reason

Source:
Returns:
Type
Promise
Example

Remove a member from the Conversation.

// Remove a member
member.kick({reason_code: "Reason Code", reason_text: "Reason Text"})
.then(() => {
    console.log("Successfully removed member.");
}).catch((error) => {
    console.error("Error removing member: ", error);
});

// Remove yourself
conversation.me.kick({reason_code: "Reason Code", reason_text: "Reason Text"})
.then(() => {
    console.log("Successfully removed yourself.");
}).catch((error) => {
    console.error("Error removing yourself: ", error);
});

mute(mute, streamIndex)

Mute your stream.

Parameters:
Name Type Argument Default Description
mute boolean <optional>

true for mute, false for unmute

streamIndex number <optional>
null

stream index of the stream

Source:
Returns:
Type
Promise
Example

Mute audio stream of your Member.

// Mute yourself
conversation.me.mute(true);

// Unmute yourself
conversation.me.mute(false);

Events


media:stream:on

Member listening for audio stream on.

Properties:
Name Type Argument Description
payload.streamIndex number

the index number of this stream

payload.rtc_id number <optional>

the rtc_id / leg_id

payload.remote_member_id string <optional>

the id of the Member the stream belongs to

payload.name string <optional>

the stream's display name

payload.stream MediaStream

the stream that is activated

payload.audio_mute boolean <optional>

if the audio is muted

Source: