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,
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,

View file

@ -47,7 +47,7 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
smallWidgetRef: React.MutableRefObject<SmallWidget | null>,
iframeRef: React.MutableRefObject<HTMLIFrameElement | null>,
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(() => {