mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(voice): give window shares their own audio scope (#2446)
This commit is contained in:
1 parent
0d8116d73e
commit
bc7f701e87
23 files changed
+1252
-611
No files matched your search
@@ -40,7 +40,6 @@ import {
|
||||
} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedDesktopControls';
|
||||
import {UnreadBadgeCustomizationControl} from '@app/features/user/components/modals/tabs/advanced_settings_tab/AdvancedExperimentalControls';
|
||||
import {
|
||||
ManualScreenShareAudioSourcesControl,
|
||||
OpenH264Control,
|
||||
ScreenShareAv1OptInControl,
|
||||
ScreenShareCodecControl,
|
||||
@@ -88,7 +87,6 @@ export const DIRECT_CONTROL_ITEM_IDS = new Set([
|
||||
'voice-video-screen-share-av1-opt-in',
|
||||
'voice-video-screen-share-hevc-opt-in',
|
||||
'voice-video-openh264-codec',
|
||||
'voice-video-manual-screen-share-audio-sources',
|
||||
'voice-video-screen-share-preview-behavior',
|
||||
'voice-video-screen-share-encoder-controls',
|
||||
'advanced-unread-badge-customization',
|
||||
@@ -125,7 +123,6 @@ export const COMPACT_SWITCH_CONTROL_ITEM_IDS = new Set([
|
||||
'voice-video-new-device-alerts',
|
||||
'voice-video-connection-volume-controls',
|
||||
'voice-video-openh264-codec',
|
||||
'voice-video-manual-screen-share-audio-sources',
|
||||
'voice-video-screen-share-av1-opt-in',
|
||||
'voice-video-screen-share-hevc-opt-in',
|
||||
'advanced-unread-badge-customization',
|
||||
@@ -286,10 +283,6 @@ export const AdvancedSettingControl = observer(({item}: {item: SearchableSetting
|
||||
return (
|
||||
<OpenH264Control data-flx="user.advanced-setting-direct-controls.advanced-setting-control.open-h264-control" />
|
||||
);
|
||||
case 'voice-video-manual-screen-share-audio-sources':
|
||||
return (
|
||||
<ManualScreenShareAudioSourcesControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.manual-screen-share-audio-sources-control" />
|
||||
);
|
||||
case 'voice-video-screen-share-preview-behavior':
|
||||
return (
|
||||
<ScreenSharePreviewBehaviorControl data-flx="user.advanced-setting-direct-controls.advanced-setting-control.screen-share-preview-behavior-control" />
|
||||
|
||||
-33
@@ -28,11 +28,8 @@ import {
|
||||
selectAutomaticScreenShareCodec,
|
||||
} from '@app/features/voice/utils/CodecCapabilityDetector';
|
||||
import {getGpuEncoderReportSync, loadGpuEncoderReport} from '@app/features/voice/utils/GpuEncoderCapabilities';
|
||||
import {getNativeAudioAvailabilitySnapshot} from '@app/features/voice/utils/NativeAudioCaptureBridge';
|
||||
import {setOpenH264Enabled} from '@app/features/voice/utils/OpenH264Status';
|
||||
import {CODEC_DISPLAY_LABEL} from '@app/features/voice/utils/ScreenShareCodecPolicy';
|
||||
import {reapplyActiveScreenShareAudioSources} from '@app/features/voice/utils/ScreenShareStartFlow';
|
||||
import {maySupportManualScreenShareAudioSourceSelection} from '@app/features/voice/utils/StreamSettingsUpdatePolicy';
|
||||
import {msg} from '@lingui/core/macro';
|
||||
import {useLingui} from '@lingui/react/macro';
|
||||
import {GearIcon} from '@phosphor-icons/react';
|
||||
@@ -192,11 +189,6 @@ const HEVC_SCREEN_SHARE_OPT_IN_DESCRIPTOR = msg({
|
||||
comment:
|
||||
'Switch label for the H.265/HEVC screen-share opt-in. H.265 and HEVC are codec names and should stay literal.',
|
||||
});
|
||||
const MANUAL_SCREEN_SHARE_AUDIO_SOURCES_DESCRIPTOR = msg({
|
||||
message: 'Pick the apps to capture audio from',
|
||||
comment:
|
||||
'Switch label for the advanced opt-in that reveals a manual per-application audio source picker in the stream settings menu.',
|
||||
});
|
||||
const SCREEN_SHARE_CODEC_OPTION_ORDER = ['av1', 'h265', 'h264', 'vp9', 'vp8'] as const;
|
||||
|
||||
export const ScreenShareCodecControl = observer(() => {
|
||||
@@ -269,31 +261,6 @@ export const ScreenShareHevcOptInControl = observer(() => {
|
||||
);
|
||||
});
|
||||
|
||||
export const ManualScreenShareAudioSourcesControl = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
if (!isDesktop()) return null;
|
||||
if (
|
||||
!maySupportManualScreenShareAudioSourceSelection({
|
||||
platform: getElectronAPI()?.platform,
|
||||
nativeAudioAvailability: getNativeAudioAvailabilitySnapshot(),
|
||||
})
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<Switch
|
||||
ariaLabel={i18n._(MANUAL_SCREEN_SHARE_AUDIO_SOURCES_DESCRIPTOR)}
|
||||
value={VoiceSettings.getScreenShareManualAudioSourcesOptIn()}
|
||||
onChange={(value) => {
|
||||
VoiceSettingsCommands.update({screenShareManualAudioSourcesOptIn: value});
|
||||
void reapplyActiveScreenShareAudioSources();
|
||||
}}
|
||||
compact
|
||||
data-flx="user.advanced-settings-tab.switch.manual-screen-share-audio-sources"
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
export const OpenH264Control = observer(() => {
|
||||
const {i18n} = useLingui();
|
||||
const handleChange = useCallback((value: boolean) => {
|
||||
|
||||
Reference in new issue
Block a user