mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Don't show audio language option if language is undetermined
as a viewer i want simple option so i - don't need to see unnecessary option - have more simple option by not showing audio language option if language is undetermined fix https://github.com/TeamPiped/Piped/issues/1761
This commit is contained in:
parent
5047aa9bcc
commit
9e54cf6a48
1 changed files with 15 additions and 8 deletions
|
@ -472,14 +472,7 @@ export default {
|
||||||
|
|
||||||
this.$ui = new shaka.ui.Overlay(localPlayer, this.$refs.container, videoEl);
|
this.$ui = new shaka.ui.Overlay(localPlayer, this.$refs.container, videoEl);
|
||||||
|
|
||||||
const overflowMenuButtons = [
|
const overflowMenuButtons = ["quality", "captions", "picture_in_picture", "playback_rate", "airplay"];
|
||||||
"quality",
|
|
||||||
"language",
|
|
||||||
"captions",
|
|
||||||
"picture_in_picture",
|
|
||||||
"playback_rate",
|
|
||||||
"airplay",
|
|
||||||
];
|
|
||||||
|
|
||||||
if (this.isEmbed) {
|
if (this.isEmbed) {
|
||||||
overflowMenuButtons.push("open_new_tab");
|
overflowMenuButtons.push("open_new_tab");
|
||||||
|
@ -544,6 +537,20 @@ export default {
|
||||||
player.selectAudioLanguage(lang);
|
player.selectAudioLanguage(lang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(() => {
|
||||||
|
const audioLanguages = player.getAudioLanguages();
|
||||||
|
if (audioLanguages.length == 1 && audioLanguages[0] == "und") return;
|
||||||
|
|
||||||
|
const overflowMenuButtons = this.$ui.getConfiguration().overflowMenuButtons;
|
||||||
|
// append language menu on index 1
|
||||||
|
const newOverflowMenuButtons = [
|
||||||
|
...overflowMenuButtons.slice(0, 1),
|
||||||
|
"language",
|
||||||
|
...overflowMenuButtons.slice(1),
|
||||||
|
];
|
||||||
|
this.$ui.configure("overflowMenuButtons", newOverflowMenuButtons);
|
||||||
|
})();
|
||||||
|
|
||||||
if (qualityConds) {
|
if (qualityConds) {
|
||||||
var leastDiff = Number.MAX_VALUE;
|
var leastDiff = Number.MAX_VALUE;
|
||||||
var bestStream = null;
|
var bestStream = null;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue