summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/asciidoctor/converter/html5.rb4
-rw-r--r--test/blocks_test.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/asciidoctor/converter/html5.rb b/lib/asciidoctor/converter/html5.rb
index 48ca4db8..9b9febe4 100644
--- a/lib/asciidoctor/converter/html5.rb
+++ b/lib/asciidoctor/converter/html5.rb
@@ -1101,13 +1101,13 @@ Your browser does not support the audio tag.
end
delimiter = ['?']
start_anchor = (node.attr? 'start') ? %(#{delimiter.pop || '&'}time=#{node.attr 'start'}) : ''
- loop_param = (node.attr? 'loopBehavior') ? %(#{delimiter.pop || '&'}endVideoBehavior=#{node.attr 'loopBehavior'}) : ''
+ end_video_behavior_param = (node.option? 'loop') ? %(#{delimiter.pop || '&'}endVideoBehavior=loop) : ((node.option? 'reset') ? %(#{delimiter.pop || '&'}endVideoBehavior=reset) : '')
target = (node.attr 'target')
autoplay_param = (node.option? 'autoplay') ? %(#{delimiter.pop || '&'}autoPlay=true) : ''
muted_param = (node.option? 'muted') ? %(#{delimiter.pop || '&'}muted=true) : ''
%(<div#{id_attribute}#{class_attribute}>#{title_element}
<div class="content">
-<iframe#{width_attribute}#{height_attribute} src="#{asset_uri_scheme}//fast.wistia.com/embed/iframe/#{target}#{start_anchor}#{autoplay_param}#{loop_param}#{muted_param}" frameborder="0"#{(node.option? 'nofullscreen') ? '' : (append_boolean_attribute 'allowfullscreen', xml)} class="wistia_embed" name="wistia_embed"></iframe>
+<iframe#{width_attribute}#{height_attribute} src="#{asset_uri_scheme}//fast.wistia.com/embed/iframe/#{target}#{start_anchor}#{autoplay_param}#{end_video_behavior_param}#{muted_param}" frameborder="0"#{(node.option? 'nofullscreen') ? '' : (append_boolean_attribute 'allowfullscreen', xml)} class="wistia_embed" name="wistia_embed"></iframe>
</div>
</div>)
else
diff --git a/test/blocks_test.rb b/test/blocks_test.rb
index 1cb9cd4d..78e9ed0c 100644
--- a/test/blocks_test.rb
+++ b/test/blocks_test.rb
@@ -3261,17 +3261,17 @@ context 'Blocks' do
end
test 'video macro should output custom HTML with iframe for wistia service' do
- input = 'video::be5gtsbaco[wistia,640,360,start=60,options="autoplay,muted"]'
+ input = 'video::be5gtsbaco[wistia,640,360,start=60,options="autoplay,loop,muted"]'
output = convert_string_to_embedded input
assert_css 'video', output, 0
assert_css 'iframe', output, 1
- assert_css 'iframe[src="https://fast.wistia.com/embed/iframe/be5gtsbaco?time=60&autoPlay=true&muted=true"]', output, 1
+ assert_css 'iframe[src="https://fast.wistia.com/embed/iframe/be5gtsbaco?time=60&autoPlay=true&endVideoBehavior=loop&muted=true"]', output, 1
assert_css 'iframe[width="640"]', output, 1
assert_css 'iframe[height="360"]', output, 1
end
test 'video macro should output custom HTML with iframe for wistia service with loop behavior set' do
- input = 'video::be5gtsbaco[wistia,640,360,start=60,loopBehavior="reset",options="autoplay,muted"]'
+ input = 'video::be5gtsbaco[wistia,640,360,start=60,options="autoplay,reset,muted"]'
output = convert_string_to_embedded input
assert_css 'video', output, 0
assert_css 'iframe', output, 1