summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2019-09-09 23:57:49 -0600
committerGitHub <noreply@github.com>2019-09-09 23:57:49 -0600
commitb263dce45e0f8cdcd8963771cda87c26745e3529 (patch)
treeb1a262cc047fcc4376c2911a6d4eaf79a2851903
parent0eeec59e28762cb4f37cf83a73d70007dc10bbff (diff)
resolves #3408 add support for muted option on self-hosted video (PR #3411)
-rw-r--r--lib/asciidoctor/converter/html5.rb2
-rw-r--r--test/blocks_test.rb3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/asciidoctor/converter/html5.rb b/lib/asciidoctor/converter/html5.rb
index 5089166d..72f8f7e8 100644
--- a/lib/asciidoctor/converter/html5.rb
+++ b/lib/asciidoctor/converter/html5.rb
@@ -1089,7 +1089,7 @@ Your browser does not support the audio tag.
time_anchor = (start_t || end_t) ? %(#t=#{start_t || ''}#{end_t ? ",#{end_t}" : ''}) : ''
%(<div#{id_attribute}#{class_attribute}>#{title_element}
<div class="content">
-<video src="#{node.media_uri(node.attr 'target')}#{time_anchor}"#{width_attribute}#{height_attribute}#{poster_attribute}#{(node.option? 'autoplay') ? (append_boolean_attribute 'autoplay', xml) : ''}#{(node.option? 'nocontrols') ? '' : (append_boolean_attribute 'controls', xml)}#{(node.option? 'loop') ? (append_boolean_attribute 'loop', xml) : ''}#{preload_attribute}>
+<video src="#{node.media_uri(node.attr 'target')}#{time_anchor}"#{width_attribute}#{height_attribute}#{poster_attribute}#{(node.option? 'autoplay') ? (append_boolean_attribute 'autoplay', xml) : ''}#{(node.option? 'muted') ? (append_boolean_attribute 'muted', xml) : ''}#{(node.option? 'nocontrols') ? '' : (append_boolean_attribute 'controls', xml)}#{(node.option? 'loop') ? (append_boolean_attribute 'loop', xml) : ''}#{preload_attribute}>
Your browser does not support the video tag.
</video>
</div>
diff --git a/test/blocks_test.rb b/test/blocks_test.rb
index 62ca6099..14355540 100644
--- a/test/blocks_test.rb
+++ b/test/blocks_test.rb
@@ -2739,10 +2739,11 @@ context 'Blocks' do
end
test 'video macro should honor all options' do
- input = 'video::cats-vs-dogs.avi[options="autoplay,nocontrols,loop",preload="metadata"]'
+ input = 'video::cats-vs-dogs.avi[options="autoplay,muted,nocontrols,loop",preload="metadata"]'
output = convert_string_to_embedded input
assert_css 'video', output, 1
assert_css 'video[autoplay]', output, 1
+ assert_css 'video[muted]', output, 1
assert_css 'video:not([controls])', output, 1
assert_css 'video[loop]', output, 1
assert_css 'video[preload=metadata]', output, 1