A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(app): make corner volume control the focused stream (#2928)
Hampusc2c0fdb445e6
diff --git a/fluxer_app/src/features/voice/components/VoiceCallCornerControls.tsx b/fluxer_app/src/features/voice/components/VoiceCallCornerControls.tsxindex 99a8ab8a1..87304bf26 100644--- a/fluxer_app/src/features/voice/components/VoiceCallCornerControls.tsx+++ b/fluxer_app/src/features/voice/components/VoiceCallCornerControls.tsx@@ -24,6 +24,7 @@ interface VoiceCallCornerControlsProps {fullscreenLabel: string;fullscreenIcon: Icon;onToggleFullscreen: () => void;+ volumeControl?: React.ReactNode;}export const VoiceCallCornerControls: React.FC<VoiceCallCornerControlsProps> = ({@@ -36,6 +37,7 @@ export const VoiceCallCornerControls: React.FC<VoiceCallCornerControlsProps> = (fullscreenLabel,fullscreenIcon,onToggleFullscreen,+ volumeControl,}) => {const {i18n} = useLingui();const PopOutIcon = useMemo(() => {@@ -52,7 +54,12 @@ export const VoiceCallCornerControls: React.FC<VoiceCallCornerControlsProps> = (}, []);return (<div className={wrapClassName} data-flx="voice.voice-call-corner-controls.wrap">- <CallVolumeControl className={buttonClassName} data-flx="voice.voice-call-corner-controls.call-volume-control" />+ {volumeControl ?? (+ <CallVolumeControl+ className={buttonClassName}+ data-flx="voice.voice-call-corner-controls.call-volume-control"+ />+ )}{showPopout && onPopOut && (<ChannelHeaderIconicon={PopOutIcon}diff --git a/fluxer_app/src/features/voice/components/VoiceCallView.tsx b/fluxer_app/src/features/voice/components/VoiceCallView.tsxindex 71fd2a918..640ad383e 100644--- a/fluxer_app/src/features/voice/components/VoiceCallView.tsx+++ b/fluxer_app/src/features/voice/components/VoiceCallView.tsx@@ -627,20 +627,6 @@ const VoiceCallViewInner = observer({connectionStateText}</div>)}- {isFocusedOnScreenShare && focusedStreamKey && hasFocusedStreamAudio && canControlFocusedStreamVolume && (- <MediaVerticalVolumeControl- volume={focusedStreamVolume / 100}- isMuted={isFocusedStreamMuted}- maxVolume={VOICE_VOLUME_MAX_SLIDER_VOLUME}- onVolumeChange={handleFocusedStreamVolumeChange}- onToggleMute={handleFocusedStreamToggleMute}- iconSize={18}- className={styles.voiceHeaderIconButton}- position="below"- ariaLabel={i18n._(STREAM_VOLUME_DESCRIPTOR)}- data-flx="voice.voice-call-view.voice-call-view-inner.hud-stream-volume-control"- />- )}{statsButton}{isMobile && (<ChannelHeaderIcon@@ -712,6 +698,22 @@ const VoiceCallViewInner = observer(fullscreenLabel={fullscreenButtonLabel}fullscreenIcon={FullscreenButtonIcon}onToggleFullscreen={handleToggleVoiceCallAppFullscreen}+ volumeControl={+ isFocusedOnScreenShare && focusedStreamKey && hasFocusedStreamAudio && canControlFocusedStreamVolume ? (+ <MediaVerticalVolumeControl+ volume={focusedStreamVolume / 100}+ isMuted={isFocusedStreamMuted}+ maxVolume={VOICE_VOLUME_MAX_SLIDER_VOLUME}+ onVolumeChange={handleFocusedStreamVolumeChange}+ onToggleMute={handleFocusedStreamToggleMute}+ iconSize={18}+ className={styles.voiceHeaderIconButton}+ position="above"+ ariaLabel={i18n._(STREAM_VOLUME_DESCRIPTOR)}+ data-flx="voice.voice-call-view.voice-call-view-inner.stream-volume-control"+ />+ ) : undefined+ }data-flx="voice.voice-call-view.voice-call-view-inner.voice-call-corner-controls"/>{isMobile && (