ChannelWebRtcClient
ChannelWebRtcClient:
TypedEventEmitter<ChannelWebRtcEvents> &object
Type declaration
kick()
Parameters
| Parameter | Type |
|---|---|
request | ChannelWebRtcKickRequest |
Returns
Promise<void>
Example
import {
ChannelWebRtcMuteAndDeafenRequest,
ChannelGuid,
UserGuid,
DeviceGuid,
rootServer,
} from "@rootsdk/server-bot";
export async function kickExample(
channelId: ChannelGuid,
userId: UserGuid,
deviceId?: DeviceGuid,
): Promise<void> {
try {
// Set up the request
const request: ChannelWebRtcKickRequest = {
channelId: channelId,
userId: userId,
deviceId: deviceId,
};
// Call the API
await rootServer.community.channelWebRtcs.kick(request);
} catch (error) {
// Detect error
throw error;
}
}
list()
Parameters
| Parameter | Type |
|---|---|
request | ChannelWebRtcListRequest |
Returns
Promise<ChannelWebRtcListResponse>
Example
import {
ChannelWebRtcListRequest,
ChannelWebRtcListResponse,
ChannelGuid,
rootServer,
} from "@rootsdk/server-bot";
export async function listExample(
channelId: ChannelGuid,
): Promise<ChannelWebRtcListResponse> {
try {
// Set up the request
const request: ChannelWebRtcListRequest = {
channelId: channelId,
};
// Call the API
const response: ChannelWebRtcListResponse =
await rootServer.community.channelWebRtcs.list(request);
return response;
} catch (error) {
// Detect error
throw error;
}
}
setMuteAndDeafenOther()
Parameters
| Parameter | Type |
|---|---|
request | ChannelWebRtcSetMuteAndDeafenOtherRequest |
Returns
Promise<void>
Example
import {
ChannelWebRtcSetMuteAndDeafenOtherRequest,
ChannelGuid,
UserGuid,
rootServer,
} from "@rootsdk/server-bot";
export async function setMuteAndDeafenOtherExample(
channelId: ChannelGuid,
userId: UserGuid,
isMuted?: boolean,
isDeafened?: boolean,
): Promise<void> {
try {
// Set up the request
const request: ChannelWebRtcSetMuteAndDeafenOtherRequest = {
channelId: channelId,
userId: userId,
isMuted: isMuted,
isDeafened: isDeafened,
};
// Call the API
await rootServer.community.channelWebRtcs.setMuteAndDeafenOther(request);
} catch (error) {
// Detect error
throw error;
}
}