From 99cae93ab624e3f4a6d00a4dc0c40da4edd24dc9 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Sat, 14 Feb 2026 11:26:54 -0500 Subject: [PATCH] feat: Disable webcam by default using callIntent='audio' --- src/app/features/call/SmallWidget.ts | 11 ++++++----- .../pages/client/call/PersistentCallContainer.tsx | 13 +++++++------ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/app/features/call/SmallWidget.ts b/src/app/features/call/SmallWidget.ts index 0f9e4064..0f15b321 100644 --- a/src/app/features/call/SmallWidget.ts +++ b/src/app/features/call/SmallWidget.ts @@ -40,7 +40,7 @@ export const getWidgetUrl = ( roomId: string, elementCallUrl: string, widgetId: string, - setParams: any + setParams: any, ): URL => { const baseUrl = window.location.origin; const url = elementCallUrl @@ -54,6 +54,7 @@ export const getWidgetUrl = ( skipLobby: setParams.skipLobby ?? 'true', // TODO: skipLobby is deprecated, use intent instead (intent doesn't produce the same effect?) returnToLobby: setParams.returnToLobby ?? 'true', perParticipantE2EE: setParams.perParticipantE2EE ?? 'true', + callIntent: setParams.callIntent ?? 'video', header: 'none', confineToRoom: 'true', theme: setParams.theme ?? 'dark', @@ -123,7 +124,7 @@ export class SmallWidget extends EventEmitter { this.mockWidget, WidgetKind.Room, true, - this.roomId + this.roomId, ); this.iframe = iframe; this.messaging = new ClientWidgetApi(this.mockWidget, iframe, driver); @@ -189,7 +190,7 @@ export class SmallWidget extends EventEmitter { // MAKE PERSISTENT HERE // Send the ack after the widget actually has become sticky. } - } + }, ); return this.messaging; @@ -345,7 +346,7 @@ export const getWidgetData = ( client: MatrixClient, roomId: string, currentData: object, - overwriteData: object + overwriteData: object, ): IWidgetData => { // Example: Determine E2EE based on room state if needed const perParticipantE2EE = true; // Default or based on logic @@ -381,7 +382,7 @@ export const createVirtualWidget = ( url: URL, waitForIframeLoad: boolean, data: IWidgetData, - roomId: string + roomId: string, ): IApp => ({ client, id, diff --git a/src/app/pages/client/call/PersistentCallContainer.tsx b/src/app/pages/client/call/PersistentCallContainer.tsx index ea435a4c..3b5f8954 100644 --- a/src/app/pages/client/call/PersistentCallContainer.tsx +++ b/src/app/pages/client/call/PersistentCallContainer.tsx @@ -47,7 +47,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro smallWidgetRef: React.MutableRefObject, iframeRef: React.MutableRefObject, skipLobby: boolean, - themeKind: ThemeKind | null + themeKind: ThemeKind | null, ) => { if (mx?.getUserId()) { if (activeCallRoomId && !isActiveCallReady) { @@ -64,7 +64,8 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro returnToLobby: 'true', perParticipantE2EE: 'true', theme: themeKind, - } + callIntent: 'audio', + }, ); if ( @@ -96,8 +97,8 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro 'm.call', newUrl, true, - getWidgetData(mx, roomIdToSet, {}, { skipLobby: true }), - roomIdToSet + getWidgetData(mx, roomIdToSet, {}, { skipLobby: true, callIntent: 'audio' }), + roomIdToSet, ); const smallWidget = new SmallWidget(app); @@ -109,7 +110,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro roomIdToSet, widgetApiRef.current, smallWidget, - iframeElement + iframeElement, ); } } @@ -121,7 +122,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro clientConfig.elementCallUrl, activeClientWidget, registerActiveClientWidgetApi, - ] + ], ); useEffect(() => {