Hakim El Hattab 10 年之前
父节点
当前提交
e19931abab
共有 1 个文件被更改,包括 10 次插入7 次删除
  1. 10 7
      js/reveal.js

+ 10 - 7
js/reveal.js

@@ -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