Skip to content

Commit

Permalink
Feat/vad parameter (#87)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
Yohan Totting and Yohan Totting authored Jan 7, 2024
1 parent 815a375 commit cde23e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/room/api/api-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export declare namespace RoomAPIType {
type RegisterClientRequestBody = {
uid?: string
name?: string
enable_vad?: boolean
}

type Bitrates = {
Expand Down
6 changes: 5 additions & 1 deletion packages/room/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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

Expand Down

0 comments on commit cde23e4

Please sign in to comment.