mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
fix(voice): hide stream volume without remote share audio (#2401)
This commit is contained in:
1 parent
7bd021cd5c
commit
250db2fdab
35 files changed
+319
-308
No files matched your search
@@ -58,7 +58,11 @@ import {
|
||||
asVoiceEngineConnectionState,
|
||||
VoiceEngineConnectionState,
|
||||
} from '@app/features/voice/engine/VoiceConnectionStateMachine';
|
||||
import {asVoiceTrackSource, VoiceTrackSource} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import {
|
||||
asVoiceTrackSource,
|
||||
isScreenShareAudioPublicationLike,
|
||||
VoiceTrackSource,
|
||||
} from '@app/features/voice/engine/VoiceTrackSource';
|
||||
import PopoutWindowManager, {
|
||||
getVoiceCallPopoutKey,
|
||||
isVoicePopoutSupported,
|
||||
@@ -274,6 +278,13 @@ const VoiceCallViewInner = observer(
|
||||
return getStreamKey(channel.guildId, channel.id, focusedStreamInfo.connectionId);
|
||||
}, [focusedStreamInfo, channel.guildId, channel.id]);
|
||||
const focusedStreamTrackInfo = useStreamTrackInfo(isFocusedOnScreenShare ? effectiveFocusMainTrack : null);
|
||||
const hasFocusedStreamAudio = Boolean(
|
||||
effectiveFocusMainTrack &&
|
||||
[...effectiveFocusMainTrack.participant.audioTrackPublications.values()].some((publication) =>
|
||||
isScreenShareAudioPublicationLike(publication),
|
||||
),
|
||||
);
|
||||
const canControlFocusedStreamVolume = focusedStreamInfo !== null && !effectiveFocusMainTrack?.participant.isLocal;
|
||||
const focusedStreamerDisplayName = useMemo(() => {
|
||||
if (!focusedStreamerUser) return '';
|
||||
return NicknameUtils.getNickname(focusedStreamerUser, channel.guildId, channel.id);
|
||||
@@ -615,7 +626,7 @@ const VoiceCallViewInner = observer(
|
||||
{connectionStateText}
|
||||
</div>
|
||||
)}
|
||||
{isFocusedOnScreenShare && focusedStreamKey && (
|
||||
{isFocusedOnScreenShare && focusedStreamKey && hasFocusedStreamAudio && canControlFocusedStreamVolume && (
|
||||
<MediaVerticalVolumeControl
|
||||
volume={focusedStreamVolume / 100}
|
||||
isMuted={isFocusedStreamMuted}
|
||||
|
||||
Reference in new issue
Block a user