Add player title and thumbnail

This commit is contained in:
Omar Roth
2018-03-07 16:48:26 -06:00
parent 212ba05047
commit 24fc14ac7a
4 changed files with 8 additions and 8 deletions

View File

@@ -1,9 +1,7 @@
<audio id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<audio poster="<%= thumbnail %>" title="<%= video.title%>" id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<% adaptive_fmts.each do |fmt| %>
<% url = fmt["url"]? %>
<% type = fmt["type"]? ? fmt["type"].to_s.split(";")[0] : "" %>
<% if type.starts_with?("audio") %>
<source src="<%= url %>" type="<%= type %>">
<% if fmt["type"].starts_with?("audio") %>
<source src="<%= fmt["url"] %>" type='<%= fmt["type"] %>'>
<% end %>
<% end %>
</audio>

View File

@@ -1,5 +1,5 @@
<video id="player" class="video-js" data-setup="{}" style="width:100%;" controls>
<video poster="<%= thumbnail %>" title="<%= 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"]? ? fmt["type"].to_s.split(";")[0] : "" %>">
<source src="<%= fmt["url"]? %>" type='<%= fmt["type"]? %>'>
<% end %>
</video>