From 2bb7acc4d79625f854bb8c6a7462548f72cf2f1c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 14:05:23 +0200 Subject: [PATCH] Can specify a maximum number of users for video calls --- config.json | 3 ++- src/helpers/CallsHelper.ts | 4 +++- src/helpers/ConfigHelper.ts | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) 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 {