Skip to main content

ChannelWebRtcClient

ChannelWebRtcClient: TypedEventEmitter<ChannelWebRtcEvents> & object

Type declaration

kick()

Parameters

ParameterType
requestChannelWebRtcKickRequest

Returns

Promise<void>

Example

import {
ChannelWebRtcMuteAndDeafenRequest,
ChannelGuid,
UserGuid,
DeviceGuid,
rootServer,
} from "@rootsdk/server-app";

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

ParameterType
requestChannelWebRtcListRequest

Returns

Promise<ChannelWebRtcListResponse>

Example

import {
ChannelWebRtcListRequest,
ChannelWebRtcListResponse,
ChannelGuid,
rootServer,
} from "@rootsdk/server-app";

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

ParameterType
requestChannelWebRtcSetMuteAndDeafenOtherRequest

Returns

Promise<void>

Example

import {
ChannelWebRtcSetMuteAndDeafenOtherRequest,
ChannelGuid,
UserGuid,
rootServer,
} from "@rootsdk/server-app";

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;
}
}