mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Add label to fmt_stream
This commit is contained in:
parent
21ef842a2e
commit
2a4b643539
2 changed files with 3 additions and 2 deletions
|
@ -271,7 +271,8 @@ get "/watch" do |env|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
fmt_stream = fmt_stream.uniq { |s| s["quality"] }
|
fmt_stream.each { |s| s.add("label", "#{s["quality"]} - #{s["type"].split(";")[0].split("/")[1]}") }
|
||||||
|
fmt_stream = fmt_stream.uniq { |s| s["label"] }
|
||||||
|
|
||||||
video_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("video") ? s : nil }
|
video_streams = adaptive_fmts.compact_map { |s| s["type"].starts_with?("video") ? s : nil }
|
||||||
video_streams = video_streams.uniq { |s| s["size"] }
|
video_streams = video_streams.uniq { |s| s["size"] }
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<video playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js" data-setup="{}" controls>
|
<video playsinline poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js" data-setup="{}" controls>
|
||||||
<% fmt_stream.each_with_index do |fmt, i| %>
|
<% fmt_stream.each_with_index do |fmt, i| %>
|
||||||
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["quality"] %>" selected="<%= i == 0 ? true : false %>">
|
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["label"] %>" selected="<%= i == 0 ? true : false %>">
|
||||||
<% end %>
|
<% end %>
|
||||||
</video>
|
</video>
|
Loading…
Reference in a new issue