9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/bluedoc/sml/rules/video.rb', line 9
def self.to_html(node, opts = {})
attrs = attributes(node)
return "" if attrs[:src].blank?
width = attrs[:width]
if width == 0 || width.blank?
width = "100%"
end
video_attrs = html_attrs(
width: width
)
nid_attr = name_by_attrs(attrs)
out = " <video controls preload=\"no\"\#{video_attrs}\#{nid_attr}>\n <source src=\"\#{attrs[:src]}\" type=\"\#{attrs[:type]}\">\n </video>\n HTML\n\n out\nend\n"
|