docs/source/_static/presentations/js/reveal.js
/**
	 * Cues a new automated slide if enabled in the config.
	 */
Cues a new automated slide if enabled in the config.
Cues a new automated slide if enabled in the config .
function cueAutoSlide() {
		cancelAutoSlide();
		if( currentSlide ) {
			var parentAutoSlide = currentSlide.parentNode ? currentSlide.parentNode.getAttribute( 'data-autoslide' ) : null;
			var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' );
			if( slideAutoSlide ) {
				autoSlide = parseInt( slideAutoSlide, 10 );
			}
			else if( parentAutoSlide ) {
				autoSlide = parseInt( parentAutoSlide, 10 );
			}
			else {
				autoSlide = config.autoSlide;
			}
			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 && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || config.loop === true ) ) {
				autoSlideTimeout = setTimeout( navigateNext, autoSlide );
				autoSlideStartTime = Date.now();
			}
			if( autoSlidePlayer ) {
				autoSlidePlayer.setPlaying( autoSlideTimeout !== -1 );
			}
		}
	}
function cueAutoSlide ( ) { cancelAutoSlide ( ) ; if ( currentSlide ) { var parentAutoSlide = currentSlide . parentNode ? currentSlide . parentNode . getAttribute ( 'data-autoslide' ) : null ; var slideAutoSlide = currentSlide . getAttribute ( 'data-autoslide' ) ; if ( slideAutoSlide ) { autoSlide = parseInt ( slideAutoSlide , 10 ) ; } else if ( parentAutoSlide ) { autoSlide = parseInt ( parentAutoSlide , 10 ) ; } else { autoSlide = config . autoSlide ; } 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 && ! autoSlidePaused && ! isPaused ( ) && ! isOverview ( ) && ( ! Reveal . isLastSlide ( ) || config . loop === true ) ) { autoSlideTimeout = setTimeout ( navigateNext , autoSlide ) ; autoSlideStartTime = Date . now ( ) ; } if ( autoSlidePlayer ) { autoSlidePlayer . setPlaying ( autoSlideTimeout !== - 1 ) ; } } }
Cues a new automated slide if enabled in the config.
Cues a new automated slide if enabled in the config .
// Pick value in the following priority order: // 1. Current slide's data-autoslide // 2. Parent slide's data-autoslide // 3. Global autoSlide setting // If there are media elements with data-autoplay, // automatically set the autoSlide duration to the // length of that media // Cue the next auto-slide if: // - There is an autoSlide value // - Auto-sliding isn't paused by the user // - The presentation isn't paused // - The overview isn't active // - The presentation isn't over