mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-01-22 04:27:00 +00:00
refactor: simplify and fix audio language selection
This commit is contained in:
parent
21e7482962
commit
17414a3e58
@ -609,16 +609,11 @@ export default {
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
const isSafari = window.navigator?.vendor?.includes("Apple");
|
const isSafari = window.navigator?.vendor?.includes("Apple");
|
||||||
|
|
||||||
|
let lang = "en";
|
||||||
if (!isSafari) {
|
if (!isSafari) {
|
||||||
// Set the audio language
|
// Set the audio language
|
||||||
const prefLang = this.getPreferenceString("hl", "en").substr(0, 2);
|
const prefLang = this.getPreferenceString("hl", "en").substr(0, 2);
|
||||||
var lang = "en";
|
if (player.getAudioLanguages().includes(prefLang)) lang = prefLang;
|
||||||
for (var l of player.getAudioLanguages()) {
|
|
||||||
if (l == prefLang) {
|
|
||||||
lang = l;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
player.selectAudioLanguage(lang);
|
player.selectAudioLanguage(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@
|
|||||||
<input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" />
|
<input id="chkAutoLoop" v-model="selectedAutoLoop" class="ml-1.5" type="checkbox" @change="onChange($event)" />
|
||||||
<br />
|
<br />
|
||||||
<label for="chkAutoPlay"><strong v-text="`${$t('actions.auto_play_next_video')}:`" /></label>
|
<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="0">none</option>
|
||||||
<option value="1">playlist only</option>
|
<option value="1">playlist only</option>
|
||||||
<option value="2">playlist and recommendations</option>
|
<option value="2">playlist and recommendations</option>
|
||||||
|
Loading…
Reference in New Issue
Block a user