summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheFrenchGhosty <47571719+TheFrenchGhosty@users.noreply.github.com>2020-12-08 18:00:36 +0000
committerGitHub <noreply@github.com>2020-12-08 18:00:36 +0000
commit28ca5b2b57fad510ed3f877bb6662b095e3c41c1 (patch)
treebcd409e8049677cf4972f0a7665a0379fab81244 /src
parenteea6f5cbfaed81e181ac29e56804a36a33b522af (diff)
parent0cb442d40ece54b40da1f8415d874c18a1f7f9b5 (diff)
downloadinvidious-28ca5b2b57fad510ed3f877bb6662b095e3c41c1.tar.gz
invidious-28ca5b2b57fad510ed3f877bb6662b095e3c41c1.tar.bz2
invidious-28ca5b2b57fad510ed3f877bb6662b095e3c41c1.zip
Merge pull request #1552 from azhao-squareup/master
do not proxy hls livestrem on supported browser
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr1
-rw-r--r--src/invidious/views/components/player.ecr2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index c4ca9c08..cdf64696 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -197,6 +197,7 @@ before_all do |env|
extra_media_csp = ""
if CONFIG.disabled?("local") || !preferences.local
extra_media_csp += " https://*.googlevideo.com:443"
+ extra_media_csp += " https://*.youtube.com:443"
end
# TODO: Remove style-src's 'unsafe-inline', requires to remove all inline styles (<style> [..] </style>, style=" [..] ")
env.response.headers["Content-Security-Policy"] = "default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; manifest-src 'self'; media-src 'self' blob:#{extra_media_csp}"
diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr
index 0e6664fa..625c6fee 100644
--- a/src/invidious/views/components/player.ecr
+++ b/src/invidious/views/components/player.ecr
@@ -4,7 +4,7 @@
<% if params.video_loop %>loop<% end %>
<% if params.controls %>controls<% end %>>
<% if (hlsvp = video.hls_manifest_url) && !CONFIG.disabled?("livestreams") %>
- <source src="<%= URI.parse(hlsvp).full_path %>?local=true" type="application/x-mpegURL" label="livestream">
+ <source src="<%= URI.parse(hlsvp).full_path %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream">
<% else %>
<% if params.listen %>
<% audio_streams.each_with_index do |fmt, i| %>