diff --git a/packages/room/api/api-types.d.ts b/packages/room/api/api-types.d.ts index b7633898..152c9f72 100644 --- a/packages/room/api/api-types.d.ts +++ b/packages/room/api/api-types.d.ts @@ -26,6 +26,7 @@ export declare namespace RoomAPIType { type RegisterClientRequestBody = { uid?: string name?: string + enable_vad?: boolean } type Bitrates = { diff --git a/packages/room/api/api.js b/packages/room/api/api.js index f1faa54a..f57316eb 100644 --- a/packages/room/api/api.js +++ b/packages/room/api/api.js @@ -121,7 +121,7 @@ export const createApi = ({ fetcher }) => { /** * @param {string} roomId - * @param {{clientId?: string, clientName?: string}} [config] + * @param {{clientId?: string, clientName?: string, enableVAD?: boolean}} [config] */ registerClient = async (roomId, config = {}) => { if (typeof roomId !== 'string' || roomId.trim().length === 0) { @@ -139,6 +139,10 @@ export const createApi = ({ fetcher }) => { body.name = config.clientName } + if (typeof config.enableVAD === 'boolean') { + body.enable_vad = config.enableVAD + } + const options = body.uid || body.name ? { body: JSON.stringify(body) } : undefined