diff --git a/src/components/Player.vue b/src/components/Player.vue index 8b5aad47..2185e631 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -95,7 +95,9 @@ export default { const MseSupport = window.MediaSource !== undefined; - const lbry = this.video.videoStreams.filter(stream => stream.quality === "LBRY")[0]; + const lbry = this.getPreferenceBoolean("disableLBRY", false) + ? null + : this.video.videoStreams.filter(stream => stream.quality === "LBRY")[0]; var uri; @@ -112,6 +114,12 @@ export default { } else uri = this.video.dash; } else if (lbry) { uri = lbry.url; + if (this.getPreferenceBoolean("proxyLBRY", false)) { + const url = new URL(uri); + url.searchParams.set("host", url.host); + url.host = new URL(this.video.proxyUrl).host; + uri = url.toString(); + } } else { uri = this.video.videoStreams.filter(stream => stream.codec == null).slice(-1)[0].url; } diff --git a/src/components/Preferences.vue b/src/components/Preferences.vue index 7da2e88f..12920582 100644 --- a/src/components/Preferences.vue +++ b/src/components/Preferences.vue @@ -106,6 +106,14 @@ +
+ +
+ +
+ +
+

@@ -181,6 +189,8 @@ export default { { code: "tr", name: "Turkish" }, ], enabledCodecs: ["av1", "vp9", "avc"], + disableLBRY: false, + proxyLBRY: false, }; }, activated() { @@ -267,6 +277,8 @@ export default { this.watchHistory = this.getPreferenceBoolean("watchHistory", false); this.selectedLanguage = this.getPreferenceString("hl", "en"); this.enabledCodecs = this.getPreferenceString("enabledCodecs", "av1,vp9,avc").split(","); + this.disableLBRY = this.getPreferenceBoolean("disableLBRY", false); + this.proxyLBRY = this.getPreferenceBoolean("proxyLBRY", false); } }, methods: { @@ -307,6 +319,8 @@ export default { localStorage.setItem("watchHistory", this.watchHistory); localStorage.setItem("hl", this.selectedLanguage); localStorage.setItem("enabledCodecs", this.enabledCodecs.join(",")); + localStorage.setItem("disableLBRY", this.disableLBRY); + localStorage.setItem("proxyLBRY", this.proxyLBRY); if (shouldReload) window.location.reload(); } diff --git a/src/locales/en.json b/src/locales/en.json index 79c9c85f..09ea4428 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -44,6 +44,8 @@ "store_watch_history": "Store Watch History", "language_selection": "Language Selection", "instances_list": "Instances List", - "enabled_codecs": "Enabled Codecs (Multiple)" + "enabled_codecs": "Enabled Codecs (Multiple)", + "disable_lbry": "Disable LBRY for Streaming", + "enable_lbry_proxy": "Enable Proxy for LBRY" } }