From cde23e4a0ef3a85b7f62f20e3bf5067ba8e9f48a Mon Sep 17 00:00:00 2001 From: Yohan Totting Date: Sun, 7 Jan 2024 14:08:30 +0800 Subject: [PATCH] Feat/vad parameter (#87) * merge screenshare and getmedia add stream * fix property add event method to stream instance * get codec and bitrates config from room * make fetch request debugable * add enable vad parameter on create room --------- Co-authored-by: Yohan Totting --- packages/room/api/api-types.d.ts | 1 + packages/room/api/api.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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