diff --git a/src/components/Player.vue b/src/components/Player.vue index 92e2fdc..4dd1481 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -110,12 +110,16 @@ export default { } mime = 'application/dash+xml' } else if (lbry) { - const contentType = await fetch(uri, { + uri = lbry.url + if (this.$store.getters['prefs/getPreferenceBoolean']('proxyLBRY', true)) { + const url = new URL(uri) + url.searchParams.set('host', url.host) + url.host = new URL(this.video.proxyUrl).host + uri = url.toString() + } + mime = await fetch(uri, { method: 'HEAD' }).then(response => response.headers.get('Content-Type')) - - mime = contentType - uri = lbry.uri } else if (this.video.hls) { uri = this.video.hls mime = 'application/x-mpegURL' diff --git a/src/routes/Preferences.vue b/src/routes/Preferences.vue index a71759d..158259d 100644 --- a/src/routes/Preferences.vue +++ b/src/routes/Preferences.vue @@ -50,6 +50,11 @@ export default { type: 'bool', default: false }, + { + id: 'proxyLBRY', + type: 'bool', + default: true + }, { id: 'homepage', type: 'select', diff --git a/src/store/prefs-store.js b/src/store/prefs-store.js index d3ddef3..d062a88 100644 --- a/src/store/prefs-store.js +++ b/src/store/prefs-store.js @@ -7,7 +7,8 @@ const PrefsStore = { prefs: { playerAutoplay: true, autoplay: false, - listen: false + listen: false, + proxyLBRY: true } }), mutations: { diff --git a/src/translations/en.json b/src/translations/en.json index 0021055..81b0dd7 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -50,6 +50,7 @@ "enabled_codecs": "Enabled Codecs (Multiple)" }, "preferences": { + "proxyLBRY": "Proxy LBRY videos", "playerAutoplay": "Autoplay Video", "bufferGoal": "Buffering Goal", "listen": "Audio Only",