Skip to content

Commit

Permalink
refactor: simplify and fix audio language selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Bnyro committed Jan 7, 2025
1 parent 21e7482 commit 17414a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions src/components/VideoPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/WatchVideo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 17414a3

Please sign in to comment.