refactor: simplify and fix audio language selection

This commit is contained in:
Bnyro 2025-01-07 12:56:57 +01:00
parent 21e7482962
commit 17414a3e58
2 changed files with 3 additions and 8 deletions

View File

@ -609,16 +609,11 @@ export default {
.then(() => {
const isSafari = window.navigator?.vendor?.includes("Apple");
let lang = "en";
if (!isSafari) {
// Set the audio language
const prefLang = this.getPreferenceString("hl", "en").substr(0, 2);
var lang = "en";
for (var l of player.getAudioLanguages()) {
if (l == prefLang) {
lang = l;
return;
}
}
if (player.getAudioLanguages().includes(prefLang)) lang = prefLang;
player.selectAudioLanguage(lang);
}

View File

@ -212,7 +212,7 @@
<input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" />
<br />
<label for="chkAutoPlay"><strong v-text="`${$t('actions.auto_play_next_video')}:`" /></label>
<select id="chkAutoPlay" v-model="selectedAutoPlay" class="ml-1.5 select" @change="onChange($event)">
<select id="chkAutoPlay" v-model="selectedAutoPlay" class="select ml-1.5" @change="onChange($event)">
<option value="0">none</option>
<option value="1">playlist only</option>
<option value="2">playlist and recommendations</option>