2025-05-16 11:32:32 +02:00
|
|
|
/*
|
|
|
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
|
|
|
Please see LICENSE in the repository root for full details.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { combineLatest, map, startWith } from "rxjs";
|
|
|
|
|
|
|
|
|
|
import { setOutputEnabled$ } from "../controls";
|
|
|
|
|
import { muteAllAudio as muteAllAudioSetting } from "../settings/settings";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This can transition into sth more complete: `GroupCallViewModel.ts`
|
|
|
|
|
*/
|
|
|
|
|
export const muteAllAudio$ = combineLatest([
|
|
|
|
|
setOutputEnabled$,
|
|
|
|
|
muteAllAudioSetting.value$,
|
|
|
|
|
]).pipe(
|
2025-05-19 13:35:21 +02:00
|
|
|
startWith([true, muteAllAudioSetting.getValue()]),
|
|
|
|
|
map(([outputEnabled, settingsMute]) => !outputEnabled || settingsMute),
|
2025-05-16 11:32:32 +02:00
|
|
|
);
|