new Member(conversation, params)
An individual user (i.e. conversation member).
Parameters:
| Name | Type | Description |
|---|---|---|
conversation |
Conversation | |
params |
object |
Methods
-
earmuff(earmuff)
-
Earmuff yourself in the Conversation.
Parameters:
Name Type Description earmuffboolean true or false
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 reasonobject <optional>
the reason for kicking out a member
Properties
Name Type Argument Description reason_codestring <optional>
the code of the reason
reason_textstring <optional>
the description of the reason
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 muteboolean <optional>
true for mute, false for unmute
streamIndexnumber <optional>
null stream index of the stream
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.
- Source:
Properties:
Name Type Argument Description payload.streamIndexnumber the index number of this stream
payload.rtc_idnumber <optional>
the rtc_id / leg_id
payload.remote_member_idstring <optional>
the id of the Member the stream belongs to
payload.namestring <optional>
the stream's display name
payload.streamMediaStream the stream that is activated
payload.audio_muteboolean <optional>
if the audio is muted