use config to unmute full package on localhost

This commit is contained in:
Valere
2026-01-09 15:00:57 +01:00
parent ad66d10c69
commit 8535494671
5 changed files with 9 additions and 3 deletions

View File

@@ -15,5 +15,6 @@
"delayed_leave_event_delay_ms": 18000,
"delayed_leave_event_restart_ms": 4000,
"network_error_retry_ms": 100
}
},
"trust_localhost_for_mute_state": true
}

View File

@@ -1,7 +1,7 @@
#!/bin/sh
if [ -n "$USE_DOCKER" ]; then
set -ex
yarn build --mode development
yarn build
docker build -t element-call:testing .
exec docker run --rm --name element-call-testing -p 8080:8080 -v ./config/config.devenv.json:/app/config.json:ro,Z element-call:testing
else

View File

@@ -164,6 +164,9 @@ export interface ResolvedConfigOptions extends ConfigOptions {
};
ssla: string;
app_prompt: boolean;
// For privacy reasons when lobby is skipped we do not unmute by default on full builds
// but for development builds we want to unmute by default to speed up testing.
trust_localhost_for_mute_state: boolean;
}
export const DEFAULT_CONFIG: ResolvedConfigOptions = {
@@ -178,4 +181,5 @@ export const DEFAULT_CONFIG: ResolvedConfigOptions = {
},
ssla: "https://static.element.io/legal/element-software-and-services-license-agreement-uk-1.pdf",
app_prompt: true,
trust_localhost_for_mute_state: false,
};

View File

@@ -79,6 +79,7 @@ export const RoomPage: FC = () => {
urlParams,
import.meta.env.VITE_PACKAGE,
window.location.hostname,
Config.get().trust_localhost_for_mute_state,
),
),
);

View File

@@ -19,7 +19,7 @@ export function calculateInitialMuteState(
urlParams: Pick<UrlParams, "skipLobby" | "callIntent">,
packageType: "full" | "embedded",
hostname: string | undefined = undefined,
trustLocalhost: boolean = import.meta.env.DEV,
trustLocalhost: boolean = false,
): { audioEnabled: boolean; videoEnabled: boolean } {
const { skipLobby, callIntent } = urlParams;