Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-video-auto-enabled.md
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion src/app/hooks/useCallEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
10 changes: 7 additions & 3 deletions src/app/plugins/call/CallEmbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@

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(
Expand Down Expand Up @@ -310,7 +314,7 @@
if (this.call === null) return;
const raw = ev.getEffectiveEvent();
this.call.feedStateUpdate(raw as IRoomEvent).catch((e) => {
console.error('Error sending state update to widget: ', e);

Check warning on line 317 in src/app/plugins/call/CallEmbed.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
});
}

Expand Down Expand Up @@ -416,7 +420,7 @@
} else {
const raw = ev.getEffectiveEvent();
this.call.feedEvent(raw as IRoomEvent).catch((e) => {
console.error('Error sending event to widget: ', e);

Check warning on line 423 in src/app/plugins/call/CallEmbed.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected console statement
});
}
}
Expand Down
Loading