mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 13:05:32 +09:00
fix(app): share stream audio by default and reset the opt-out per stream (#1819)
This commit is contained in:
1 parent
14e772a751
commit
137edc7cfb
4 files changed
+35
-5
No files matched your search
@@ -2326,6 +2326,7 @@ class MediaEngineFacade extends Store {
|
|||||||
sendUpdate?: boolean;
|
sendUpdate?: boolean;
|
||||||
playSound?: boolean;
|
playSound?: boolean;
|
||||||
restartIfEnabled?: boolean;
|
restartIfEnabled?: boolean;
|
||||||
|
preserveStreamAudioPreferences?: boolean;
|
||||||
},
|
},
|
||||||
publishOptions?: TrackPublishOptions,
|
publishOptions?: TrackPublishOptions,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
|
|||||||
+10
@@ -7,6 +7,7 @@ import {SoundType} from '@app/features/notification/utils/SoundUtils';
|
|||||||
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
|
import * as ModalCommands from '@app/features/ui/commands/ModalCommands';
|
||||||
import * as SoundCommands from '@app/features/ui/commands/SoundCommands';
|
import * as SoundCommands from '@app/features/ui/commands/SoundCommands';
|
||||||
import {getElectronAPI} from '@app/features/ui/utils/NativeUtils';
|
import {getElectronAPI} from '@app/features/ui/utils/NativeUtils';
|
||||||
|
import * as VoiceSettingsCommands from '@app/features/voice/commands/VoiceSettingsCommands';
|
||||||
import {getStreamKey} from '@app/features/voice/components/StreamKeys';
|
import {getStreamKey} from '@app/features/voice/components/StreamKeys';
|
||||||
import AdaptiveScreenShareEngine from '@app/features/voice/engine/AdaptiveScreenShareEngine';
|
import AdaptiveScreenShareEngine from '@app/features/voice/engine/AdaptiveScreenShareEngine';
|
||||||
import type {NegotiationReason} from '@app/features/voice/engine/ScreenShareCodecNegotiation';
|
import type {NegotiationReason} from '@app/features/voice/engine/ScreenShareCodecNegotiation';
|
||||||
@@ -691,11 +692,20 @@ class VoiceEngineV2AppScreenShareExecutionAdapter extends Store {
|
|||||||
playSound?: boolean;
|
playSound?: boolean;
|
||||||
restartIfEnabled?: boolean;
|
restartIfEnabled?: boolean;
|
||||||
reason?: string;
|
reason?: string;
|
||||||
|
preserveStreamAudioPreferences?: boolean;
|
||||||
},
|
},
|
||||||
publishOptions?: TrackPublishOptions,
|
publishOptions?: TrackPublishOptions,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
assert.equal(typeof enabled, 'boolean');
|
assert.equal(typeof enabled, 'boolean');
|
||||||
await this.controllerRouting.setEnabled(room, enabled, options, publishOptions);
|
await this.controllerRouting.setEnabled(room, enabled, options, publishOptions);
|
||||||
|
if (!enabled && options?.preserveStreamAudioPreferences !== true) {
|
||||||
|
VoiceSettingsCommands.update({
|
||||||
|
shareAppAudio: true,
|
||||||
|
shareDesktopAudio: true,
|
||||||
|
shareDeviceAudio: true,
|
||||||
|
muteStreamAudio: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async executeScreenShareSetEnabledDirect(
|
async executeScreenShareSetEnabledDirect(
|
||||||
|
|||||||
@@ -216,6 +216,18 @@ function applyScreenShareAudioConsentMigrationV1(parsed: Record<string, unknown>
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function applyScreenShareAudioDefaultOnMigrationV1(parsed: Record<string, unknown>): boolean {
|
||||||
|
if (parsed.screenShareAudioDefaultOnMigratedV1 === true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
parsed.shareAppAudio = true;
|
||||||
|
parsed.shareDesktopAudio = true;
|
||||||
|
parsed.shareDeviceAudio = true;
|
||||||
|
parsed.muteStreamAudio = false;
|
||||||
|
parsed.screenShareAudioDefaultOnMigratedV1 = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
function applyStreamingModeDefaultMigrationV1(parsed: Record<string, unknown>): boolean {
|
function applyStreamingModeDefaultMigrationV1(parsed: Record<string, unknown>): boolean {
|
||||||
if (parsed.streamingModeDefaultMigratedV1 === true) {
|
if (parsed.streamingModeDefaultMigratedV1 === true) {
|
||||||
return false;
|
return false;
|
||||||
@@ -284,12 +296,13 @@ class VoiceSettings {
|
|||||||
streamingMode: StreamingMode = 'screenshare';
|
streamingMode: StreamingMode = 'screenshare';
|
||||||
streamingModeDefaultMigratedV1 = false;
|
streamingModeDefaultMigratedV1 = false;
|
||||||
hideStreamPreview = false;
|
hideStreamPreview = false;
|
||||||
muteStreamAudio = true;
|
muteStreamAudio = false;
|
||||||
shareAppAudio = false;
|
shareAppAudio = true;
|
||||||
shareDesktopAudio = false;
|
shareDesktopAudio = true;
|
||||||
shareDeviceAudio = false;
|
shareDeviceAudio = true;
|
||||||
screenShareAudioDeviceId = 'default';
|
screenShareAudioDeviceId = 'default';
|
||||||
screenShareAudioConsentMigratedV1 = false;
|
screenShareAudioConsentMigratedV1 = false;
|
||||||
|
screenShareAudioDefaultOnMigratedV1 = false;
|
||||||
outputVolumeRecalibratedV1 = false;
|
outputVolumeRecalibratedV1 = false;
|
||||||
backgroundImageId = NONE_BACKGROUND_ID;
|
backgroundImageId = NONE_BACKGROUND_ID;
|
||||||
backgroundImages: Array<BackgroundImage> = [];
|
backgroundImages: Array<BackgroundImage> = [];
|
||||||
@@ -424,6 +437,7 @@ class VoiceSettings {
|
|||||||
changed = applyPiPPopoutDefaultsMigration(parsed) || changed;
|
changed = applyPiPPopoutDefaultsMigration(parsed) || changed;
|
||||||
changed = applyAdaptiveScreenShareQualityMigrationV2(parsed) || changed;
|
changed = applyAdaptiveScreenShareQualityMigrationV2(parsed) || changed;
|
||||||
changed = applyScreenShareAudioConsentMigrationV1(parsed) || changed;
|
changed = applyScreenShareAudioConsentMigrationV1(parsed) || changed;
|
||||||
|
changed = applyScreenShareAudioDefaultOnMigrationV1(parsed) || changed;
|
||||||
changed = applyStreamingModeDefaultMigrationV1(parsed) || changed;
|
changed = applyStreamingModeDefaultMigrationV1(parsed) || changed;
|
||||||
changed = applyOutputVolumeRecalibrationMigrationV1(parsed) || changed;
|
changed = applyOutputVolumeRecalibrationMigrationV1(parsed) || changed;
|
||||||
if (changed) {
|
if (changed) {
|
||||||
@@ -463,6 +477,7 @@ class VoiceSettings {
|
|||||||
'shareDeviceAudio',
|
'shareDeviceAudio',
|
||||||
'screenShareAudioDeviceId',
|
'screenShareAudioDeviceId',
|
||||||
'screenShareAudioConsentMigratedV1',
|
'screenShareAudioConsentMigratedV1',
|
||||||
|
'screenShareAudioDefaultOnMigratedV1',
|
||||||
'outputVolumeRecalibratedV1',
|
'outputVolumeRecalibratedV1',
|
||||||
'backgroundImageId',
|
'backgroundImageId',
|
||||||
'backgroundImages',
|
'backgroundImages',
|
||||||
|
|||||||
@@ -357,7 +357,11 @@ async function runConfiguredDisplayScreenShare(
|
|||||||
logger.warn('No active screen share to restart for Wayland portal source switch');
|
logger.warn('No active screen share to restart for Wayland portal source switch');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
await MediaEngine.setScreenShareEnabled(false, {sendUpdate: false, playSound: false});
|
await MediaEngine.setScreenShareEnabled(false, {
|
||||||
|
sendUpdate: false,
|
||||||
|
playSound: false,
|
||||||
|
preserveStreamAudioPreferences: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
let nativeAudioArmed = false;
|
let nativeAudioArmed = false;
|
||||||
const isOwnWindowShare = options?.isOwnWindow === true && sourceId?.startsWith('window:');
|
const isOwnWindowShare = options?.isOwnWindow === true && sourceId?.startsWith('window:');
|
||||||
|
|||||||
Reference in new issue
Block a user