aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2020-05-26 10:56:02 +0200
committerHakim El Hattab <hakim.elhattab@gmail.com>2020-05-26 10:56:02 +0200
commitb1e5db0ec9647532c4a2e9f05101329c3129eb97 (patch)
tree906a31f0127c0e1b351cfdcc7bcc309da176ba28 /js
parentb7487b8b4f4b9f6a230cdfc3de327473c5e900b8 (diff)
downloadfosdem-2021-minimalism-presentation-b1e5db0ec9647532c4a2e9f05101329c3129eb97.tar
fosdem-2021-minimalism-presentation-b1e5db0ec9647532c4a2e9f05101329c3129eb97.tar.gz
data-autoslide attribute takes precedence over video duration
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 4807369..231efcb 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2067,21 +2067,21 @@ export default function( revealElement, options ) {
}
else {
autoSlide = config.autoSlide;
- }
- // If there are media elements with data-autoplay,
- // automatically set the autoSlide duration to the
- // length of that media. Not applicable if the slide
- // is divided up into fragments.
- // playbackRate is accounted for in the duration.
- if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
- Util.queryAll( currentSlide, 'video, audio' ).forEach( el => {
- if( el.hasAttribute( 'data-autoplay' ) ) {
- if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) {
- autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000;
+ // If there are media elements with data-autoplay,
+ // automatically set the autoSlide duration to the
+ // length of that media. Not applicable if the slide
+ // is divided up into fragments.
+ // playbackRate is accounted for in the duration.
+ if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
+ Util.queryAll( currentSlide, 'video, audio' ).forEach( el => {
+ if( el.hasAttribute( 'data-autoplay' ) ) {
+ if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) {
+ autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000;
+ }
}
- }
- } );
+ } );
+ }
}
// Cue the next auto-slide if: