Skip to content

Commit

Permalink
fix #1170
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Mar 25, 2015
1 parent 70ab0ae commit e19931a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3501,14 +3501,17 @@

// If there are media elements with data-autoplay,
// automatically set the autoSlide duration to the
// length of that media
toArray( currentSlide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {
if( el.hasAttribute( 'data-autoplay' ) ) {
if( autoSlide && el.duration * 1000 > autoSlide ) {
autoSlide = ( el.duration * 1000 ) + 1000;
// length of that media. Not applicable if the slide
// is divided up into fragments.
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;
}
}
}
} );
} );
}

// Cue the next auto-slide if:
// - There is an autoSlide value
Expand Down

0 comments on commit e19931a

Please sign in to comment.