Fix audio-only for video.js

This commit is contained in:
Omar Roth
2018-01-16 14:02:35 -06:00
parent 9e4d0bd3a5
commit f09f971af7
2 changed files with 15 additions and 14 deletions

View File

@@ -2,21 +2,23 @@
<%= video.info["title"] + " - " %>
<% end %>
<video id="player" class="video-js" data-setup="{}" style="width:100%" controls>
<% if listen == "true" %>
<% adaptive_fmts.each do |fmt| %>
<% url = fmt["url"] %>
<% type = fmt["type"].to_s.split(";")[0] %>
<% if type.starts_with?("audio") %>
<source src="<%= url %>" type="<%= type %>">
<% end %>
<% end %>
<% else %>
<% fmt_stream.each do |fmt| %>
<source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>">
<% if listen == "true" %>
<audio id="player" class="video-js" data-setup="{}" style="width:100%" controls>
<% adaptive_fmts.each do |fmt| %>
<% url = fmt["url"] %>
<% type = fmt["type"].to_s.split(";")[0] %>
<% if type.starts_with?("audio") %>
<source src="<%= url %>" type="<%= type %>">
<% end %>
<% end %>
</audio>
<% else %>
<video id="player" class="video-js" data-setup="{}" style="width:100%" controls>
<% fmt_stream.each do |fmt| %>
<source src="<%= fmt["url"] %>" type="<%= fmt["type"].split(";")[0] %>">
<% end %>
</video>
<% end %>
<script>
var options = {