Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

background-video doesn't honor imagesdir attribute like it should #356

Merged
merged 3 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions examples/video.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// :header_footer:
= Video tests
:revealjs_hash: true
:imagesdir: images/

== YouTube Auto-sized

Expand All @@ -25,14 +26,26 @@ This video is auto-sized!
video::https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm[]

[%notitle,background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&start=3&enablejsapi=1&autoplay=1&loop=1&controls=0&modestbranding=1"]
== background
== background video at URL

[%notitle,background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm",background-video-loop=true,background-video-muted=true]
== video file, named attributes
== background video at URL with named attributes

[background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm",options="loop,muted,notitle"]
== background video at URL with options

// Download this file and put in examples/images/ for this to be visible
// https://github.com/obilodeau/asciidoctor-assets/blob/master/videos/synthwave.mp4
[%notitle,background-video="synthwave.mp4",background-video-loop=true,background-video-muted=true]
== background video file with named attributes

// Download this file and put in examples/images/ for this to be visible
// https://github.com/obilodeau/asciidoctor-assets/blob/master/videos/synthwave.mp4
== video file, options

video::synthwave.mp4[options="autoplay,loop"]


== vimeo autostart

video::44878206[vimeo, options=autoplay]
Expand Down
5 changes: 4 additions & 1 deletion templates/section.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
- if attr? 'background-image'
- data_background_image = image_uri(attr 'background-image')

- if attr? 'background-video'
- data_background_video = media_uri(attr 'background-video')

- if attr? 'background-color'
- data_background_color = attr 'background-color'

Expand All @@ -47,7 +50,7 @@
data-background-transition=(data_background_transition || attr('background-transition'))
data-background-position=(data_background_position || attr('background-position'))
data-background-iframe=(attr "background-iframe")
data-background-video=(attr "background-video")
data-background-video=data_background_video
data-background-video-loop=((attr? 'background-video-loop') || (option? 'loop'))
data-background-video-muted=((attr? 'background-video-muted') || (option? 'muted'))
data-background-opacity=(attr "background-opacity")
Expand Down
15 changes: 12 additions & 3 deletions test/doctest/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,18 @@ <h2>Remote Video File Auto-sized</h2>
</div>
</div>
</section>
<section data-background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&amp;start=3&amp;enablejsapi=1&amp;autoplay=1&amp;loop=1&amp;controls=0&amp;modestbranding=1" id="_background"></section>
<section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop="" data-background-video-muted="" id="_video_file_named_attributes"></section>
<section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop="" data-background-video-muted="" id="_video_file_options"></section>
<section data-background-iframe="https://www.youtube.com/embed/LaApqL4QjH8?rel=0&amp;start=3&amp;enablejsapi=1&amp;autoplay=1&amp;loop=1&amp;controls=0&amp;modestbranding=1" id="_background_video_at_url"></section>
<section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop="" data-background-video-muted="" id="_background_video_at_url_with_named_attributes"></section>
<section data-background-video="https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm" data-background-video-loop="" data-background-video-muted="" id="_background_video_at_url_with_options"></section>
<section data-background-video="images/synthwave.mp4" data-background-video-loop="" data-background-video-muted="" id="_background_video_file_with_named_attributes"></section>
<section id="_video_file_options">
<h2>video file, options</h2>
<div class="slide-content">
<div class="videoblock stretch">
<video controls="" data-autoplay="" height="100%" loop="" src="images/synthwave.mp4" width="100%">Your browser does not support the video tag.</video>
</div>
</div>
</section>
<section id="_vimeo_autostart">
<h2>vimeo autostart</h2>
<div class="slide-content">
Expand Down