File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 41
41
42
42
< %
43
43
videos = []
44
- videos.push *((item[:attachments] or []).select{|a| a[:mime] == 'video/webm'}.map{|a| $attachments_by_export[a[:filename]][:localname]})
45
44
videos.push *((item[:links] or []).select{|l| l[:url] =~ /\.webm$/}.map{|l| l[:url]})
46
45
videos
47
46
.each do |video|
57
56
end
58
57
require 'uri'
59
58
url = video
59
+ vtt_url = item[:links].find { |l| l[:url].end_with?('.vtt') }&.[](:url)
60
60
%>
61
61
< div class ="video ">
62
- < video preload ="none " controls ="controls " width ="75% ">
62
+ < video preload ="none " controls ="controls " width ="75% " crossorigin =" anonymous " >
63
63
< source src ="<%= url %> " type ='video/webm; codecs="av01.0.08M.08.0.110.01.01.01.0" ' />
64
64
< source src ="<%= url.gsub(/\.av1\.webm$/, ".mp4 ") %> " type='video/mp4' />
65
+ < % if vtt_url %>
66
+ < track src ="<%= vtt_url %> " label ="Captions " kind ="captions " srclang ="en " />
67
+ < % end %>
65
68
</ video >
66
69
</ div >
67
70
< % end %>
You can’t perform that action at this time.
0 commit comments