diff --git a/config/config.devenv.json b/config/config.devenv.json index df0ff4c1..f99c4bbd 100644 --- a/config/config.devenv.json +++ b/config/config.devenv.json @@ -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 } diff --git a/scripts/playwright-webserver-command.sh b/scripts/playwright-webserver-command.sh index 35d5fd38..8c00909b 100755 --- a/scripts/playwright-webserver-command.sh +++ b/scripts/playwright-webserver-command.sh @@ -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 diff --git a/src/config/ConfigOptions.ts b/src/config/ConfigOptions.ts index 44cdf128..a392eb9b 100644 --- a/src/config/ConfigOptions.ts +++ b/src/config/ConfigOptions.ts @@ -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, }; diff --git a/src/room/RoomPage.tsx b/src/room/RoomPage.tsx index 488d8da9..7c98bb0d 100644 --- a/src/room/RoomPage.tsx +++ b/src/room/RoomPage.tsx @@ -79,6 +79,7 @@ export const RoomPage: FC = () => { urlParams, import.meta.env.VITE_PACKAGE, window.location.hostname, + Config.get().trust_localhost_for_mute_state, ), ), ); diff --git a/src/state/initialMuteState.ts b/src/state/initialMuteState.ts index 5fdc6a6f..f0a29a25 100644 --- a/src/state/initialMuteState.ts +++ b/src/state/initialMuteState.ts @@ -19,7 +19,7 @@ export function calculateInitialMuteState( urlParams: Pick, packageType: "full" | "embedded", hostname: string | undefined = undefined, - trustLocalhost: boolean = import.meta.env.DEV, + trustLocalhost: boolean = false, ): { audioEnabled: boolean; videoEnabled: boolean } { const { skipLobby, callIntent } = urlParams;