diff --git a/src/vector/jitsi/index.ts b/src/vector/jitsi/index.ts index 3ac4d1d3fb..7a70421986 100644 --- a/src/vector/jitsi/index.ts +++ b/src/vector/jitsi/index.ts @@ -145,7 +145,8 @@ const ack = (ev: CustomEvent) => widgetApi.transport.reply(ev widgetApi.on(`action:${ElementWidgetActions.JoinCall}`, (ev: CustomEvent) => { - joinConference(); + const { audioDevice, videoDevice } = ev.detail.data; + joinConference(audioDevice as string, videoDevice as string); ack(ev); }, ); @@ -293,7 +294,8 @@ async function notifyHangup() { } } -function joinConference() { // event handler bound in HTML +// event handler bound in HTML +function joinConference(audioDevice?: string, videoDevice?: string) { let jwt; if (jitsiAuth === JITSI_OPENIDTOKEN_JWT_AUTH) { if (!openIdToken?.access_token) { // eslint-disable-line camelcase @@ -318,6 +320,10 @@ function joinConference() { // event handler bound in HTML height: "100%", parentNode: document.querySelector("#jitsiContainer"), roomName: conferenceId, + devices: { + audioInput: audioDevice, + videoInput: videoDevice, + }, interfaceConfigOverwrite: { SHOW_JITSI_WATERMARK: false, SHOW_WATERMARK_FOR_GUESTS: false, @@ -326,6 +332,8 @@ function joinConference() { // event handler bound in HTML }, configOverwrite: { startAudioOnly, + startWithAudioMuted: !audioDevice, + startWithVideoMuted: !videoDevice, } as any, jwt: jwt, };