mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-19 20:54:28 -05:00
Add support for 'listen=1'
This commit is contained in:
parent
738e1a5415
commit
3b01bc6735
@ -221,7 +221,7 @@ get "/watch" do |env|
|
|||||||
end
|
end
|
||||||
video_end ||= -1
|
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
|
listen = true
|
||||||
env.params.query.delete_all("listen")
|
env.params.query.delete_all("listen")
|
||||||
end
|
end
|
||||||
@ -381,7 +381,7 @@ get "/embed/:id" do |env|
|
|||||||
end
|
end
|
||||||
video_end ||= -1
|
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
|
listen = true
|
||||||
env.params.query.delete_all("listen")
|
env.params.query.delete_all("listen")
|
||||||
end
|
end
|
||||||
|
@ -49,14 +49,14 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<% if listen %>
|
<% if listen %>
|
||||||
<% audio_streams.each_with_index do |fmt, i| %>
|
<% 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 %>
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% fmt_stream.each_with_index do |fmt, i| %>
|
<% fmt_stream.each_with_index do |fmt, i| %>
|
||||||
<% if preferences %>
|
<% 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 %>
|
<% 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 %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
@ -327,7 +327,7 @@ get_youtube_comments();
|
|||||||
<i class="icon ion-ios-videocam"></i>
|
<i class="icon ion-ios-videocam"></i>
|
||||||
</a>
|
</a>
|
||||||
<% else %>
|
<% 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>
|
<i class="icon ion-ios-volume-high"></i>
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
Loading…
Reference in New Issue
Block a user