From 0567a8ad604cfc935af57c9b81e5708eb3256c78 Mon Sep 17 00:00:00 2001 From: Timo Date: Fri, 30 May 2025 16:26:13 +0200 Subject: [PATCH] expose keep alive event configurarion in ec config and update defaults. --- src/config/ConfigOptions.ts | 11 +++++++++++ src/rtcSessionHelpers.ts | 3 +++ 2 files changed, 14 insertions(+) diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index 925bdc81..4efc5e27 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -14,6 +14,7 @@ export interface ConfigOptions { api_key: string; api_host: string; }; + /** * The Sentry endpoint to which crash data will be sent. * This is only used in the full package of Element Call. @@ -22,6 +23,7 @@ export interface ConfigOptions { DSN: string; environment: string; }; + /** * The rageshake server to which feedback and debug logs will be sent. * This is only used in the full package of Element Call. @@ -66,6 +68,7 @@ export interface ConfigOptions { * Allow to join group calls without audio and video. */ feature_group_calls_without_video_and_audio?: boolean; + /** * Send device-specific call session membership state events instead of * legacy user-specific call membership state events. @@ -86,6 +89,7 @@ export interface ConfigOptions { * Defines whether participants should start with audio enabled by default. */ enable_audio?: boolean; + /** * Defines whether participants should start with video enabled by default. */ @@ -121,7 +125,14 @@ export interface ConfigOptions { * How long (in milliseconds) after the last keep-alive the server should expire the * MatrixRTC membership event. */ + delayedLeaveEventDelayMs?: number; + /** @deprecated use delayedLeaveEventDelayMs instead */ membership_server_side_expiry_timeout?: number; + + /** + * The interval (in milliseconds) in which the client will send membership keep-alives to the server. + */ + delayedLeaveEventRestartMs?: number; }; } diff --git a/src/rtcSessionHelpers.ts b/src/rtcSessionHelpers.ts index e083b56c..58b767ba 100644 --- a/src/rtcSessionHelpers.ts +++ b/src/rtcSessionHelpers.ts @@ -121,7 +121,10 @@ export async function enterRTCSession( ...(useDeviceSessionMemberEvents !== undefined && { useLegacyMemberEvents: !useDeviceSessionMemberEvents, }), + delayedLeaveEventRestartMs: + matrixRtcSessionConfig?.delayedLeaveEventRestartMs, delayedLeaveEventDelayMs: + matrixRtcSessionConfig?.delayedLeaveEventDelayMs ?? matrixRtcSessionConfig?.membership_server_side_expiry_timeout, networkErrorRetryMs: matrixRtcSessionConfig?.membership_keep_alive_period, makeKeyDelay: matrixRtcSessionConfig?.key_rotation_on_leave_delay,