mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(voice): request web share audio via the browser picker (#2384)
This commit is contained in:
1 parent
475f5a7dae
commit
62577b25bb
3 files changed
+33
-2
No files matched your search
@@ -156,6 +156,32 @@ describe('buildScreenShareOptions', () => {
|
|||||||
frameRate: 30,
|
frameRate: 30,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('offers the browser picker system audio for every surface when audio is requested', () => {
|
||||||
|
const {captureOptions} = buildScreenShareOptions({
|
||||||
|
resolution: 'medium',
|
||||||
|
frameRate: 30,
|
||||||
|
includeAudio: true,
|
||||||
|
useBrowserAudioPicker: true,
|
||||||
|
});
|
||||||
|
expect(captureOptions).toMatchObject({
|
||||||
|
audio: true,
|
||||||
|
systemAudio: 'include',
|
||||||
|
windowAudio: 'system',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('keeps the browser picker audio hints excluded when audio is not requested', () => {
|
||||||
|
const {captureOptions} = buildScreenShareOptions({
|
||||||
|
resolution: 'medium',
|
||||||
|
frameRate: 30,
|
||||||
|
includeAudio: false,
|
||||||
|
useBrowserAudioPicker: true,
|
||||||
|
});
|
||||||
|
expect(captureOptions).toMatchObject({
|
||||||
|
audio: false,
|
||||||
|
systemAudio: 'exclude',
|
||||||
|
windowAudio: 'exclude',
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('forced screen share bitrate', () => {
|
describe('forced screen share bitrate', () => {
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ export interface ScreenShareBuildConfig {
|
|||||||
height: number;
|
height: number;
|
||||||
};
|
};
|
||||||
preferredDisplaySurface?: 'window' | 'monitor';
|
preferredDisplaySurface?: 'window' | 'monitor';
|
||||||
|
useBrowserAudioPicker?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScreenShareVideoOptions = NonNullable<Exclude<ScreenShareCaptureOptions['video'], true>> & {
|
type ScreenShareVideoOptions = NonNullable<Exclude<ScreenShareCaptureOptions['video'], true>> & {
|
||||||
@@ -150,8 +151,8 @@ export function buildScreenShareOptions(
|
|||||||
...(config.includeAudio ? {restrictOwnAudio: true} : {}),
|
...(config.includeAudio ? {restrictOwnAudio: true} : {}),
|
||||||
selfBrowserSurface: 'include',
|
selfBrowserSurface: 'include',
|
||||||
monitorTypeSurfaces: config.preferredDisplaySurface === 'window' ? 'exclude' : 'include',
|
monitorTypeSurfaces: config.preferredDisplaySurface === 'window' ? 'exclude' : 'include',
|
||||||
systemAudio: 'exclude',
|
systemAudio: config.includeAudio && config.useBrowserAudioPicker ? 'include' : 'exclude',
|
||||||
windowAudio: config.includeAudio ? 'window' : 'exclude',
|
windowAudio: config.includeAudio ? (config.useBrowserAudioPicker ? 'system' : 'window') : 'exclude',
|
||||||
resolution: {width, height, frameRate: resolvedFrameRate},
|
resolution: {width, height, frameRate: resolvedFrameRate},
|
||||||
video,
|
video,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -202,6 +202,9 @@ function shouldIncludeAudioForShare(
|
|||||||
if (shareContext === 'device') {
|
if (shareContext === 'device') {
|
||||||
return VoiceSettings.getShareDeviceAudio();
|
return VoiceSettings.getShareDeviceAudio();
|
||||||
}
|
}
|
||||||
|
if (displayShareEnvironment === 'web') {
|
||||||
|
return supportsDesktopScreenShareAudioCapture();
|
||||||
|
}
|
||||||
if (sourceId?.startsWith('window:')) {
|
if (sourceId?.startsWith('window:')) {
|
||||||
return supportsDesktopScreenShareAudioCapture() && VoiceSettings.getShareAppAudio();
|
return supportsDesktopScreenShareAudioCapture() && VoiceSettings.getShareAppAudio();
|
||||||
}
|
}
|
||||||
@@ -307,6 +310,7 @@ function getConfiguredScreenShareOptions(
|
|||||||
contentHint,
|
contentHint,
|
||||||
sourceDimensions,
|
sourceDimensions,
|
||||||
preferredDisplaySurface,
|
preferredDisplaySurface,
|
||||||
|
useBrowserAudioPicker: displayShareEnvironment === 'web',
|
||||||
});
|
});
|
||||||
publishOptions.videoCodec = preferredVideoCodec;
|
publishOptions.videoCodec = preferredVideoCodec;
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in new issue
Block a user