When I preview a blob in _blob.html.erb, I can preview images, but I'm having difficulty embedding video. The <video>
tag below is not showing in the webpage.
If I run the blob.service_url
function and paste its output where it is in the line <source src="<%= blob.service_url %>" type="video/mp4">
, and then manually paste the video tag into the Chrome HTML, a video player appears as I want it to, but I can't figure out why the video tag won't compile directly from the erb.html file. Does anyone know why the tag is not rendering?
<% if blob.representable? %>
<% if blob.video? %>
<video width="1024" height="768" controls>
<source src="<%= blob.service_url %>" type="video/mp4">
</video>
<%= blob.service_url %>
<% else %>
<%= image_tag blob.representation(resize_to_limit: local_assigns[:in_gallery] ? [ 800, 600 ] : [ 1024, 768 ]) %>
<% end %>
<% end %>