aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchadmorrow <chadmorrow@users.noreply.github.com>2016-09-30 17:46:32 -0700
committerHakim El Hattab <hakim.elhattab@gmail.com>2016-10-05 11:12:27 +0200
commitea8964ddbf7a603197fee093b206bc879ebabd33 (patch)
treecb1043105841019d6590f7fba61490fc6f72300d
parent255bde174cc2e8195c2c43186e40f4abad0c71cc (diff)
downloadfreenode-live-2017-presentation-ea8964ddbf7a603197fee093b206bc879ebabd33.tar
freenode-live-2017-presentation-ea8964ddbf7a603197fee093b206bc879ebabd33.tar.gz
autoSlide duration with playbackRate
The autoSlide duration of media elements with data-autoplay now takes the playbackRate of said media element into account when setting the duration so that autoSlide and the media element stay in sync.
-rw-r--r--js/reveal.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 97f2994..09cc5b6 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -3767,12 +3767,13 @@
// 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.
+ // is divided up into fragments.
+ // playbackRate is accounted for in the duration.
if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) {
toArray( currentSlide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {
if( el.hasAttribute( 'data-autoplay' ) ) {
- if( autoSlide && el.duration * 1000 > autoSlide ) {
- autoSlide = ( el.duration * 1000 ) + 1000;
+ if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) {
+ autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000;
}
}
} );