Add qualityselector

This commit is contained in:
Omar Roth
2018-03-13 18:37:56 -05:00
parent 1a6c28735c
commit e37e9a0b8e
6 changed files with 2066 additions and 39 deletions

View File

@@ -1,7 +1,5 @@
<audio poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<% adaptive_fmts.each do |fmt| %>
<% if fmt["type"].starts_with?("audio") %>
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>'>
<% end %>
<% audio_streams.each do |fmt| %>
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["bitrate"] %>k" selected="<%= audio_streams[0]["url"] == fmt["url"] ? true : false %>">
<% end %>
</audio>

View File

@@ -1,5 +1,5 @@
<video poster="<%= thumbnail %>" title="<%= HTML.escape(video.title) %>" id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<% fmt_stream.each do |fmt| %>
<source src="<%= fmt["url"]? %>" type='<%= fmt["type"]? %>'>
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>' label="<%= fmt["quality"] %>" selected="<%= fmt_stream[0]["url"] == fmt["url"] ? true : false %>">
<% end %>
</video>