diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/routes/api/manifest.cr | 4 | ||||
| -rw-r--r-- | src/invidious/views/components/player.ecr | 18 | ||||
| -rw-r--r-- | src/invidious/views/embed.ecr | 3 | ||||
| -rw-r--r-- | src/invidious/views/watch.ecr | 3 |
4 files changed, 22 insertions, 6 deletions
diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr index ca429df5..23d11f65 100644 --- a/src/invidious/routes/api/manifest.cr +++ b/src/invidious/routes/api/manifest.cr @@ -56,7 +56,7 @@ module Invidious::Routes::API::Manifest xml.element("Period") do i = 0 - {"audio/mp4", "audio/webm"}.each do |mime_type| + {"audio/mp4"}.each do |mime_type| mime_streams = audio_streams.select { |stream| stream["mimeType"].as_s.starts_with? mime_type } next if mime_streams.empty? @@ -83,7 +83,7 @@ module Invidious::Routes::API::Manifest potential_heights = {4320, 2160, 1440, 1080, 720, 480, 360, 240, 144} - {"video/mp4", "video/webm"}.each do |mime_type| + {"video/mp4"}.each do |mime_type| mime_streams = video_streams.select { |stream| stream["mimeType"].as_s.starts_with? mime_type } next if mime_streams.empty? diff --git a/src/invidious/views/components/player.ecr b/src/invidious/views/components/player.ecr index 206ba380..fffefc9a 100644 --- a/src/invidious/views/components/player.ecr +++ b/src/invidious/views/components/player.ecr @@ -7,8 +7,19 @@ <source src="<%= URI.parse(hlsvp).request_target %><% if params.local %>?local=true<% end %>" type="application/x-mpegURL" label="livestream"> <% else %> <% if params.listen %> - <% audio_streams.each_with_index do |fmt, i| %> - <source src="/latest_version?id=<%= video.id %>&itag=<%= fmt["itag"] %><% if params.local %>&local=true<% end %>" type='<%= fmt["mimeType"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>"> + <% audio_streams.each_with_index do |fmt, i| + src_url = "/latest_version?id=#{video.id}&itag=#{fmt["itag"]}" + src_url += "&local=true" if params.local + + bitrate = fmt["bitrate"] + mimetype = HTML.escape(fmt["mimeType"].as_s) + + selected = i == 0 ? true : false + %> + <source src="<%= src_url %>" type='<%= mimetype %>' label="<%= bitrate %>k" selected="<%= selected %>"> + <% if !params.local && !CONFIG.disabled?("local") %> + <source src="<%= src_url %>&local=true" type='<%= mimetype %>' hidequalityoption="true"> + <% end %> <% end %> <% else %> <% if params.quality == "dash" %> @@ -28,6 +39,9 @@ selected = params.quality ? (params.quality == quality) : (i == 0) %> <source src="<%= src_url %>" type="<%= mimetype %>" label="<%= quality %>" selected="<%= selected %>"> + <% if !params.local && !CONFIG.disabled?("local") %> + <source src="<%= src_url %>&local=true" type="<%= mimetype %>" hidequalityoption="true"> + <% end %> <% end %> <% end %> diff --git a/src/invidious/views/embed.ecr b/src/invidious/views/embed.ecr index 27a8e266..ce5ff7f0 100644 --- a/src/invidious/views/embed.ecr +++ b/src/invidious/views/embed.ecr @@ -24,7 +24,8 @@ "video_series" => video_series, "params" => params, "preferences" => preferences, - "premiere_timestamp" => video.premiere_timestamp.try &.to_unix + "premiere_timestamp" => video.premiere_timestamp.try &.to_unix, + "local_disabled" => CONFIG.disabled?("local") }.to_pretty_json %> </script> diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr index 0e4af3ab..2e493f4c 100644 --- a/src/invidious/views/watch.ecr +++ b/src/invidious/views/watch.ecr @@ -64,7 +64,8 @@ we're going to need to do it here in order to allow for translations. "preferences" => preferences, "premiere_timestamp" => video.premiere_timestamp.try &.to_unix, "vr" => video.is_vr, - "projection_type" => video.projection_type + "projection_type" => video.projection_type, + "local_disabled" => CONFIG.disabled?("local") }.to_pretty_json %> </script> |
