瀏覽代碼

when there is data-autoplay:ing media, prolong autoSlide to match its duration #723

Hakim El Hattab 11 年之前
父節點
當前提交
740f472ce2
共有 2 個文件被更改,包括 12 次插入1 次删除
  1. 11 0
      js/reveal.js
  2. 1 1
      js/reveal.min.js

+ 11 - 0
js/reveal.js

@@ -2454,6 +2454,17 @@ var Reveal = (function(){
 				autoSlide = config.autoSlide;
 			}
 
+			// 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;
+					}
+				}
+			} );
+
 			// Cue the next auto-slide if:
 			// - There is an autoSlide value
 			// - Auto-sliding isn't paused by the user

文件差異過大導致無法顯示
+ 1 - 1
js/reveal.min.js


部分文件因文件數量過多而無法顯示