mirror of
https://github.com/iv-org/invidious.git
synced 2024-08-30 18:23:25 +00:00
Add support for 'listen=1'
This commit is contained in:
parent
738e1a5415
commit
3b01bc6735
@ -221,7 +221,7 @@ get "/watch" do |env|
|
||||
end
|
||||
video_end ||= -1
|
||||
|
||||
if env.params.query["listen"]? && env.params.query["listen"] == "true"
|
||||
if env.params.query["listen"]? && env.params.query["listen"] == "true" || env.params.query["listen"] == "1"
|
||||
listen = true
|
||||
env.params.query.delete_all("listen")
|
||||
end
|
||||
@ -381,7 +381,7 @@ get "/embed/:id" do |env|
|
||||
end
|
||||
video_end ||= -1
|
||||
|
||||
if env.params.query["listen"]? && env.params.query["listen"] == "true"
|
||||
if env.params.query["listen"]? && env.params.query["listen"] == "true" || env.params.query["listen"] == "1"
|
||||
listen = true
|
||||
env.params.query.delete_all("listen")
|
||||
end
|
||||
|
@ -49,14 +49,14 @@
|
||||
<% else %>
|
||||
<% if listen %>
|
||||
<% audio_streams.each_with_index do |fmt, i| %>
|
||||
<source src="<%= fmt["url"] %>" type="<%= fmt["type"] %>" label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>">
|
||||
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= i == 0 ? true : false %>">
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% fmt_stream.each_with_index do |fmt, i| %>
|
||||
<% if preferences %>
|
||||
<source src="<%= fmt["url"] %>" type="<%= fmt["type"] %>" label="<%= fmt["label"] %>" selected="<%= preferences.quality == fmt["label"].split(" - ")[0] %>">
|
||||
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= preferences.quality == fmt["label"].split(" - ")[0] %>">
|
||||
<% else %>
|
||||
<source src="<%= fmt["url"] %>" type="<%= fmt["type"] %>" label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>">
|
||||
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>">
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@ -327,7 +327,7 @@ get_youtube_comments();
|
||||
<i class="icon ion-ios-videocam"></i>
|
||||
</a>
|
||||
<% else %>
|
||||
<a href="/watch?<%= env.params.query %>&listen=true">
|
||||
<a href="/watch?<%= env.params.query %>&listen=1">
|
||||
<i class="icon ion-ios-volume-high"></i>
|
||||
</a>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user