diff --git a/.changeset/fix-video-auto-enabled.md b/.changeset/fix-video-auto-enabled.md new file mode 100644 index 000000000..7b57773be --- /dev/null +++ b/.changeset/fix-video-auto-enabled.md @@ -0,0 +1,5 @@ +--- +default: patch +--- + +Fix Camera being enabled by default even when the client has it off pre joining in browsers that permit the video (Electron/Tauri as examples). diff --git a/src/app/hooks/useCallEmbed.ts b/src/app/hooks/useCallEmbed.ts index a5bd94b9d..aa3466193 100644 --- a/src/app/hooks/useCallEmbed.ts +++ b/src/app/hooks/useCallEmbed.ts @@ -52,7 +52,7 @@ export const createCallEmbed = ( const ongoing = MatrixRTCSession.sessionMembershipsForRoom(room, rtcSession.sessionDescription).length > 0; - const intent = CallEmbed.getIntent(dm, ongoing); + const intent = CallEmbed.getIntent(dm, ongoing, pref?.video); const widget = CallEmbed.getWidget(mx, room, intent, themeKind); const controlState = pref && new CallControlState(pref.microphone, pref.video, pref.sound); diff --git a/src/app/plugins/call/CallEmbed.ts b/src/app/plugins/call/CallEmbed.ts index 734cf1626..1a12211d4 100644 --- a/src/app/plugins/call/CallEmbed.ts +++ b/src/app/plugins/call/CallEmbed.ts @@ -52,12 +52,16 @@ export class CallEmbed { private readonly disposables: Array<() => void> = []; - static getIntent(dm: boolean, ongoing: boolean): ElementCallIntent { + static getIntent(dm: boolean, ongoing: boolean, video: boolean | undefined): ElementCallIntent { + if (!dm) { + return video ? ElementCallIntent.JoinExisting : ElementCallIntent.JoinExistingDMVoice; + } + if (ongoing) { - return dm ? ElementCallIntent.JoinExistingDM : ElementCallIntent.JoinExisting; + return video ? ElementCallIntent.JoinExistingDM : ElementCallIntent.JoinExistingDMVoice; } - return dm ? ElementCallIntent.StartCallDM : ElementCallIntent.StartCall; + return video ? ElementCallIntent.StartCallDM : ElementCallIntent.StartCallDMVoice; } static getWidget(