fix: re-apply desired device state after EC joins, support mid-call PTT

This commit is contained in:
root
2026-05-14 19:14:29 -04:00
parent 487e884e51
commit 92d6469530
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -47,6 +47,8 @@ export class CallEmbed {
private readonly disposables: Array<() => void> = [];
private readonly initialState: CallControlState;
static getIntent(dm: boolean, ongoing: boolean): ElementCallIntent {
if (ongoing) {
return dm ? ElementCallIntent.JoinExistingDM : ElementCallIntent.JoinExisting;
@@ -149,6 +151,7 @@ export class CallEmbed {
const controlState = initialControlState ?? new CallControlState(true, false, true);
this.control = new CallControl(controlState, call, iframe);
this.initialState = controlState;
let initialMediaEvent = true;
this.disposables.push(
@@ -251,6 +254,8 @@ export class CallEmbed {
this.joined = true;
this.applyStyles();
this.control.startObserving();
// EC ignores io.element.device_mute before join; re-apply desired state now that EC is live
this.control.forceState(this.initialState);
}
private applyStyles(): void {