feat: add option to favor hls over dash

This commit is contained in:
Shiny Nematoda 2024-07-11 17:59:42 +00:00
parent 174a4cc86c
commit f00b9cafcd
3 changed files with 14 additions and 2 deletions

View File

@ -69,6 +69,10 @@
<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)" />
</label> </label>
<label class="pref" for="chkPreferHls">
<strong v-t="'actions.prefer_hls'" />
<input id="chkPreferHls" v-model="preferHls" class="checkbox" type="checkbox" @change="onChange($event)" />
</label>
<label class="pref" for="ddlDefaultQuality"> <label class="pref" for="ddlDefaultQuality">
<strong v-t="'actions.default_quality'" /> <strong v-t="'actions.default_quality'" />
<select id="ddlDefaultQuality" v-model="defaultQuality" class="select w-auto" @change="onChange($event)"> <select id="ddlDefaultQuality" v-model="defaultQuality" class="select w-auto" @change="onChange($event)">
@ -438,6 +442,7 @@ export default {
autoPlayNextCountdown: 5, autoPlayNextCountdown: 5,
listen: false, listen: false,
resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320], resolutions: [144, 240, 360, 480, 720, 1080, 1440, 2160, 4320],
preferHls: false,
defaultQuality: 0, defaultQuality: 0,
bufferingGoal: 10, bufferingGoal: 10,
countryMap: CountryMap, countryMap: CountryMap,
@ -619,6 +624,7 @@ export default {
localStorage.setItem("autoDisplayCaptions", this.autoDisplayCaptions); localStorage.setItem("autoDisplayCaptions", this.autoDisplayCaptions);
localStorage.setItem("autoPlayNextCountdown", this.autoPlayNextCountdown); localStorage.setItem("autoPlayNextCountdown", this.autoPlayNextCountdown);
localStorage.setItem("listen", this.listen); localStorage.setItem("listen", this.listen);
localStorage.setItem("preferHls", this.preferHls);
localStorage.setItem("quality", this.defaultQuality); localStorage.setItem("quality", this.defaultQuality);
localStorage.setItem("bufferGoal", this.bufferingGoal); localStorage.setItem("bufferGoal", this.bufferingGoal);
localStorage.setItem("region", this.countrySelected); localStorage.setItem("region", this.countrySelected);

View File

@ -328,7 +328,12 @@ export default {
if (this.video.livestream) { if (this.video.livestream) {
uri = this.video.hls; uri = this.video.hls;
mime = "application/x-mpegURL"; mime = "application/x-mpegURL";
} else if (this.video.audioStreams.length > 0 && !lbry && MseSupport) { } else if (
this.video.audioStreams.length > 0 &&
!lbry &&
MseSupport &&
!this.getPreferenceBoolean("preferHls", false)
) {
if (!this.video.dash) { if (!this.video.dash) {
const dash = (await import("../utils/DashUtils.js")).generate_dash_file_from_formats( const dash = (await import("../utils/DashUtils.js")).generate_dash_file_from_formats(
streams, streams,

View File

@ -160,7 +160,8 @@
"creator_replied": "Creator replied", "creator_replied": "Creator replied",
"creator_liked": "Creator liked", "creator_liked": "Creator liked",
"playback_speed": "Playback speed", "playback_speed": "Playback speed",
"invalid_input": "Invalid input" "invalid_input": "Invalid input",
"prefer_hls": "Prefer HLS over DASH"
}, },
"comment": { "comment": {
"pinned_by": "Pinned by {author}", "pinned_by": "Pinned by {author}",