Files
element-call/src/state/MuteAllAudioModel.ts

20 lines
613 B
TypeScript
Raw Normal View History

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.
*/
2025-05-21 12:51:00 +02:00
import { combineLatest, startWith } from "rxjs";
2025-05-16 11:32:32 +02:00
import { setOutputEnabled$ } from "../controls";
import { muteAllAudio as muteAllAudioSetting } from "../settings/settings";
/**
* This can transition into sth more complete: `GroupCallViewModel.ts`
*/
2025-05-21 12:51:00 +02:00
export const muteAllAudio$ = combineLatest(
[setOutputEnabled$.pipe(startWith(true)), muteAllAudioSetting.value$],
(outputEnabled, settingsMute) => !outputEnabled || settingsMute,
2025-05-16 11:32:32 +02:00
);