Skip to content

Commit 78e345f

Browse files
committed
fix(ScreenObtainer) Disable desktop audio for tests
1 parent 288a1c7 commit 78e345f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/RTC/ScreenObtainer.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class ScreenObtainer {
221221
*/
222222
private _getAudioConstraints(): boolean | IAudioQuality {
223223
const { audioQuality } = this.options;
224+
const isTestModeEnabled = this.options.testing?.testMode;
224225

225226
// Chrome 140+ requires 'restrictOwnAudio' for proper audio sharing when not using stereo.
226227
// Starting Chrome 137 'echoCancellation' was turned off by default for screen share audio and needs to be
@@ -243,9 +244,9 @@ class ScreenObtainer {
243244

244245
let audio: boolean | IAudioQuality = (audioQuality?.stereo || needsEchoCancellation)
245246
? defaultAudioConstraints
246-
: true;
247+
: !isTestModeEnabled;
247248

248-
if (supportsRestrictOwnAudio) {
249+
if (supportsRestrictOwnAudio && !isTestModeEnabled) {
249250
if (typeof audio === 'boolean') {
250251
audio = {
251252
restrictOwnAudio: true

0 commit comments

Comments
 (0)