From 69eef1227550c077ee96c1c9bbae18518806515c Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 6 Dec 2022 17:31:34 +0000 Subject: [PATCH] Don't select track if safari. Closes #1793 Closes #1748 --- src/components/VideoPlayer.vue | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 941d4501..0f5dbbc9 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -491,16 +491,20 @@ export default { if (qualityConds) this.$player.configure("abr.enabled", false); player.load(uri, 0, mime).then(() => { - // Set the audio language - const prefLang = this.getPreferenceString("hl", "en").substr(0, 2); - var lang = "en"; - for (var l in player.getAudioLanguages()) { - if (l == prefLang) { - lang = l; - return; + const isSafari = window.navigator?.vendor?.includes("Apple"); + + if (!isSafari) { + // Set the audio language + const prefLang = this.getPreferenceString("hl", "en").substr(0, 2); + var lang = "en"; + for (var l in player.getAudioLanguages()) { + if (l == prefLang) { + lang = l; + return; + } } + player.selectAudioLanguage(lang); } - player.selectAudioLanguage(lang); if (qualityConds) { var leastDiff = Number.MAX_VALUE;