mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
add setting
This commit is contained in:
parent
10ba5891a3
commit
f4b370945a
4 changed files with 32 additions and 1 deletions
|
@ -45,6 +45,25 @@
|
||||||
@change="onChange($event)"
|
@change="onChange($event)"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
|
<label v-if="autoPlayVideo" class="pref" for="chkPriorityAutoPlay">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<strong v-t="'actions.priority_autoplay'" />
|
||||||
|
<font-awesome-icon icon="circle-question" class="ml-2 peer" />
|
||||||
|
<div class="peer hidden peer-hover:block relative w-0 h-0">
|
||||||
|
<div
|
||||||
|
class="absolute sm:min-w-xs min-w-[12rem] bottom-5 bg-black/80 rounded p-2"
|
||||||
|
v-t="'actions.priority_autoplay_tooltip'"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input
|
||||||
|
id="chkPriorityAutoPlay"
|
||||||
|
v-model="priorityAutoPlay"
|
||||||
|
class="checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
@change="onChange($event)"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
<label class="pref" for="chkAudioOnly">
|
<label class="pref" for="chkAudioOnly">
|
||||||
<strong v-t="'actions.audio_only'" />
|
<strong v-t="'actions.audio_only'" />
|
||||||
<input id="chkAudioOnly" v-model="listen" class="checkbox" type="checkbox" @change="onChange($event)" />
|
<input id="chkAudioOnly" v-model="listen" class="checkbox" type="checkbox" @change="onChange($event)" />
|
||||||
|
@ -403,6 +422,7 @@ export default {
|
||||||
showMarkers: true,
|
showMarkers: true,
|
||||||
selectedTheme: "dark",
|
selectedTheme: "dark",
|
||||||
autoPlayVideo: true,
|
autoPlayVideo: true,
|
||||||
|
priorityAutoPlay: false,
|
||||||
listen: false,
|
listen: false,
|
||||||
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
|
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
|
||||||
defaultQuality: 0,
|
defaultQuality: 0,
|
||||||
|
@ -548,6 +568,7 @@ export default {
|
||||||
this.showMarkers = this.getPreferenceBoolean("showMarkers", true);
|
this.showMarkers = this.getPreferenceBoolean("showMarkers", true);
|
||||||
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
this.selectedTheme = this.getPreferenceString("theme", "dark");
|
||||||
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
this.autoPlayVideo = this.getPreferenceBoolean("playerAutoPlay", true);
|
||||||
|
this.priorityAutoPlay = this.getPreferenceBoolean("priorityAutoPlay", false);
|
||||||
this.listen = this.getPreferenceBoolean("listen", false);
|
this.listen = this.getPreferenceBoolean("listen", false);
|
||||||
this.defaultQuality = Number(localStorage.getItem("quality"));
|
this.defaultQuality = Number(localStorage.getItem("quality"));
|
||||||
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
|
this.bufferingGoal = Math.max(Number(localStorage.getItem("bufferGoal")), 10);
|
||||||
|
@ -609,6 +630,7 @@ export default {
|
||||||
localStorage.setItem("showMarkers", this.showMarkers);
|
localStorage.setItem("showMarkers", this.showMarkers);
|
||||||
localStorage.setItem("theme", this.selectedTheme);
|
localStorage.setItem("theme", this.selectedTheme);
|
||||||
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
localStorage.setItem("playerAutoPlay", this.autoPlayVideo);
|
||||||
|
localStorage.setItem("priorityAutoPlay", this.priorityAutoPlay);
|
||||||
localStorage.setItem("listen", this.listen);
|
localStorage.setItem("listen", this.listen);
|
||||||
localStorage.setItem("quality", this.defaultQuality);
|
localStorage.setItem("quality", this.defaultQuality);
|
||||||
localStorage.setItem("bufferGoal", this.bufferingGoal);
|
localStorage.setItem("bufferGoal", this.bufferingGoal);
|
||||||
|
|
|
@ -58,6 +58,9 @@ export default {
|
||||||
shouldAutoPlay: _this => {
|
shouldAutoPlay: _this => {
|
||||||
return _this.getPreferenceBoolean("playerAutoPlay", true) && !_this.isEmbed;
|
return _this.getPreferenceBoolean("playerAutoPlay", true) && !_this.isEmbed;
|
||||||
},
|
},
|
||||||
|
priorityAutoPlay: _this => {
|
||||||
|
return _this.getPreferenceBoolean("priorityAutoPlay", true) && !_this.isEmbed;
|
||||||
|
},
|
||||||
preferredVideoCodecs: _this => {
|
preferredVideoCodecs: _this => {
|
||||||
var preferredVideoCodecs = [];
|
var preferredVideoCodecs = [];
|
||||||
const enabledCodecs = _this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
const enabledCodecs = _this.getPreferenceString("enabledCodecs", "vp9,avc").split(",");
|
||||||
|
@ -396,7 +399,9 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.setNextVideo();
|
if (this.priorityAutoPlay) {
|
||||||
|
this.setNextVideo();
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: Add sponsors on seekbar: https://github.com/ajayyy/SponsorBlock/blob/e39de9fd852adb9196e0358ed827ad38d9933e29/src/js-components/previewBar.ts#L12
|
//TODO: Add sponsors on seekbar: https://github.com/ajayyy/SponsorBlock/blob/e39de9fd852adb9196e0358ed827ad38d9933e29/src/js-components/previewBar.ts#L12
|
||||||
},
|
},
|
||||||
|
|
|
@ -45,6 +45,8 @@
|
||||||
"dark": "Dark",
|
"dark": "Dark",
|
||||||
"light": "Light",
|
"light": "Light",
|
||||||
"autoplay_video": "Autoplay Video",
|
"autoplay_video": "Autoplay Video",
|
||||||
|
"priority_autoplay": "Priority Autoplay",
|
||||||
|
"priority_autoplay_tooltip": "Prioritize unwatched videos from the same channel when selecting next video from related streams.",
|
||||||
"audio_only": "Audio Only",
|
"audio_only": "Audio Only",
|
||||||
"default_quality": "Default Quality",
|
"default_quality": "Default Quality",
|
||||||
"buffering_goal": "Buffering Goal (in seconds)",
|
"buffering_goal": "Buffering Goal (in seconds)",
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
faServer,
|
faServer,
|
||||||
faDonate,
|
faDonate,
|
||||||
faBookmark,
|
faBookmark,
|
||||||
|
faCircleQuestion,
|
||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
import { faGithub, faBitcoin, faYoutube } from "@fortawesome/free-brands-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
||||||
|
@ -48,6 +49,7 @@ library.add(
|
||||||
faServer,
|
faServer,
|
||||||
faDonate,
|
faDonate,
|
||||||
faBookmark,
|
faBookmark,
|
||||||
|
faCircleQuestion,
|
||||||
);
|
);
|
||||||
|
|
||||||
import router from "@/router/router.js";
|
import router from "@/router/router.js";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue