feat: Disable webcam by default using callIntent='audio'

This commit is contained in:
James Reilly 2026-02-14 11:26:54 -05:00
parent 9bc157aff2
commit 99cae93ab6
2 changed files with 13 additions and 11 deletions

View file

@ -40,7 +40,7 @@ export const getWidgetUrl = (
roomId: string, roomId: string,
elementCallUrl: string, elementCallUrl: string,
widgetId: string, widgetId: string,
setParams: any setParams: any,
): URL => { ): URL => {
const baseUrl = window.location.origin; const baseUrl = window.location.origin;
const url = elementCallUrl 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?) skipLobby: setParams.skipLobby ?? 'true', // TODO: skipLobby is deprecated, use intent instead (intent doesn't produce the same effect?)
returnToLobby: setParams.returnToLobby ?? 'true', returnToLobby: setParams.returnToLobby ?? 'true',
perParticipantE2EE: setParams.perParticipantE2EE ?? 'true', perParticipantE2EE: setParams.perParticipantE2EE ?? 'true',
callIntent: setParams.callIntent ?? 'video',
header: 'none', header: 'none',
confineToRoom: 'true', confineToRoom: 'true',
theme: setParams.theme ?? 'dark', theme: setParams.theme ?? 'dark',
@ -123,7 +124,7 @@ export class SmallWidget extends EventEmitter {
this.mockWidget, this.mockWidget,
WidgetKind.Room, WidgetKind.Room,
true, true,
this.roomId this.roomId,
); );
this.iframe = iframe; this.iframe = iframe;
this.messaging = new ClientWidgetApi(this.mockWidget, iframe, driver); this.messaging = new ClientWidgetApi(this.mockWidget, iframe, driver);
@ -189,7 +190,7 @@ export class SmallWidget extends EventEmitter {
// MAKE PERSISTENT HERE // MAKE PERSISTENT HERE
// Send the ack after the widget actually has become sticky. // Send the ack after the widget actually has become sticky.
} }
} },
); );
return this.messaging; return this.messaging;
@ -345,7 +346,7 @@ export const getWidgetData = (
client: MatrixClient, client: MatrixClient,
roomId: string, roomId: string,
currentData: object, currentData: object,
overwriteData: object overwriteData: object,
): IWidgetData => { ): IWidgetData => {
// Example: Determine E2EE based on room state if needed // Example: Determine E2EE based on room state if needed
const perParticipantE2EE = true; // Default or based on logic const perParticipantE2EE = true; // Default or based on logic
@ -381,7 +382,7 @@ export const createVirtualWidget = (
url: URL, url: URL,
waitForIframeLoad: boolean, waitForIframeLoad: boolean,
data: IWidgetData, data: IWidgetData,
roomId: string roomId: string,
): IApp => ({ ): IApp => ({
client, client,
id, id,

View file

@ -47,7 +47,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
smallWidgetRef: React.MutableRefObject<SmallWidget | null>, smallWidgetRef: React.MutableRefObject<SmallWidget | null>,
iframeRef: React.MutableRefObject<HTMLIFrameElement | null>, iframeRef: React.MutableRefObject<HTMLIFrameElement | null>,
skipLobby: boolean, skipLobby: boolean,
themeKind: ThemeKind | null themeKind: ThemeKind | null,
) => { ) => {
if (mx?.getUserId()) { if (mx?.getUserId()) {
if (activeCallRoomId && !isActiveCallReady) { if (activeCallRoomId && !isActiveCallReady) {
@ -64,7 +64,8 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
returnToLobby: 'true', returnToLobby: 'true',
perParticipantE2EE: 'true', perParticipantE2EE: 'true',
theme: themeKind, theme: themeKind,
} callIntent: 'audio',
},
); );
if ( if (
@ -96,8 +97,8 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
'm.call', 'm.call',
newUrl, newUrl,
true, true,
getWidgetData(mx, roomIdToSet, {}, { skipLobby: true }), getWidgetData(mx, roomIdToSet, {}, { skipLobby: true, callIntent: 'audio' }),
roomIdToSet roomIdToSet,
); );
const smallWidget = new SmallWidget(app); const smallWidget = new SmallWidget(app);
@ -109,7 +110,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
roomIdToSet, roomIdToSet,
widgetApiRef.current, widgetApiRef.current,
smallWidget, smallWidget,
iframeElement iframeElement,
); );
} }
} }
@ -121,7 +122,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
clientConfig.elementCallUrl, clientConfig.elementCallUrl,
activeClientWidget, activeClientWidget,
registerActiveClientWidgetApi, registerActiveClientWidgetApi,
] ],
); );
useEffect(() => { useEffect(() => {