From 2d1276e4ed0355a53f98b11550bf2bdf4c97b5ca Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Wed, 28 Feb 2024 19:30:09 +0300 Subject: [PATCH] fix: fix Chrome 115+ doesn't see other than default audio tracks --- src/scripts/browserDeviceProfile.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/scripts/browserDeviceProfile.js b/src/scripts/browserDeviceProfile.js index a7bc134e7e..5e93a0721a 100644 --- a/src/scripts/browserDeviceProfile.js +++ b/src/scripts/browserDeviceProfile.js @@ -924,16 +924,24 @@ export default function (options) { IsRequired: false }); - if (browser.firefox || browser.tizen || browser.web0s) { + // FIXME: Most likely, it is always `FirstSupported` + if (browser.chrome || browser.firefox || browser.tizen || browser.web0s) { profile.SingleAudioPolicy = 'FirstSupported'; - } else if (browser.chrome) { - // Chrome 115+ detects only default audio tracks - BROKEN - profile.SingleAudioPolicy = browser.versionMajor >= 115 ? 'DefaultSupported' : 'FirstSupported'; } else { profile.SingleAudioPolicy = 'First'; } } + if (browser.chrome && browser.versionMajor >= 115) { + // Chrome 115+ detects only default audio tracks - BROKEN + globalVideoAudioCodecProfileConditions.push({ + Condition: 'Equals', + Property: 'IsDefaultTrack', + Value: 'true', + IsRequired: false + }); + } + if (globalAudioCodecProfileConditions.length) { profile.CodecProfiles.push({ Type: 'Audio',