Files
element-call/src/lotus/lotusScreenshareAudio.ts
T

28 lines
1.1 KiB
TypeScript
Raw Normal View History

/*
Copyright 2026 Lotus Guild
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE in the repository root for full details.
*/
import { BehaviorSubject } from "rxjs";
import { globalScope } from "../state/ObservableScope";
/**
* Whether the host has muted remote screenshare AUDIO (`io.lotus.set_deafen`
* `screenshareAudioMuted`). Consumed by `LivekitRoomAudioRenderer` exactly the
* way `muteAllAudio$` is: it becomes the `muted` prop of every
* `Track.Source.ScreenShareAudio` element, so it survives re-renders, applies
* to tracks that are published LATER (a sharer stopping and re-sharing, a late
* joiner) and never fights EC's per-tile volume controls — which was the
* failure mode of the old `RemoteParticipant.setVolume(0, ScreenShareAudio)`
* approach: `createVolumeControls` writes its own volume (1) through the same
* sink the moment a new screenshare media item appears, un-muting it.
*/
export const setScreenshareAudioMuted$ = new BehaviorSubject(false);
export const muteScreenshareAudio$ = globalScope.behavior(
setScreenshareAudioMuted$,
);