diff --git a/config.json b/config.json index a286ca9..f7f2e3e 100644 --- a/config.json +++ b/config.json @@ -19,6 +19,7 @@ "stun:stun.l.google.com:19302" ], "maxUsersPerCalls": 10, - "allowVideo": true + "allowVideo": true, + "maxUsersPerVideoCalls": 4 } } \ No newline at end of file diff --git a/src/helpers/CallsHelper.ts b/src/helpers/CallsHelper.ts index 98b7eb8..6520618 100644 --- a/src/helpers/CallsHelper.ts +++ b/src/helpers/CallsHelper.ts @@ -28,7 +28,9 @@ export class CallsHelper { * @param conv Target conversation */ public static CanHaveVideoCAll(conv: Conversation) : boolean { - return this.CanHaveCall(conv) && conf().rtc_relay.allowVideo; + return this.CanHaveCall(conv) + && conf().rtc_relay.allowVideo + && conf().rtc_relay.maxUsersPerVideoCalls >= conv.members.size; } } \ No newline at end of file diff --git a/src/helpers/ConfigHelper.ts b/src/helpers/ConfigHelper.ts index 06bdab4..142e52f 100644 --- a/src/helpers/ConfigHelper.ts +++ b/src/helpers/ConfigHelper.ts @@ -22,6 +22,7 @@ export interface RTCRelayConfiguration { maxUsersPerCalls: number, allowVideo: boolean, + maxUsersPerVideoCalls: number, } export interface Configuration {