data-autoslide attribute takes precedence over video duration
This commit is contained in:
		
							parent
							
								
									b7487b8b4f
								
							
						
					
					
						commit
						b1e5db0ec9
					
				
					 4 changed files with 21 additions and 18 deletions
				
			
		
							
								
								
									
										26
									
								
								js/reveal.js
									
										
									
									
									
								
							
							
						
						
									
										26
									
								
								js/reveal.js
									
										
									
									
									
								
							|  | @ -2067,21 +2067,21 @@ export default function( revealElement, options ) { | |||
| 			} | ||||
| 			else { | ||||
| 				autoSlide = config.autoSlide; | ||||
| 			} | ||||
| 
 | ||||
| 			// 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.
 | ||||
| 			// playbackRate is accounted for in the duration.
 | ||||
| 			if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) { | ||||
| 				Util.queryAll( currentSlide, 'video, audio' ).forEach( el => { | ||||
| 					if( el.hasAttribute( 'data-autoplay' ) ) { | ||||
| 						if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) { | ||||
| 							autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000; | ||||
| 				// 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.
 | ||||
| 				// playbackRate is accounted for in the duration.
 | ||||
| 				if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) { | ||||
| 					Util.queryAll( currentSlide, 'video, audio' ).forEach( el => { | ||||
| 						if( el.hasAttribute( 'data-autoplay' ) ) { | ||||
| 							if( autoSlide && (el.duration * 1000 / el.playbackRate ) > autoSlide ) { | ||||
| 								autoSlide = ( el.duration * 1000 / el.playbackRate ) + 1000; | ||||
| 							} | ||||
| 						} | ||||
| 					} | ||||
| 				} ); | ||||
| 					} ); | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			// Cue the next auto-slide if:
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue