only auto-play media when data-autoplay is set (#388)
This commit is contained in:
		| @@ -1432,14 +1432,14 @@ var Reveal = (function(){ | ||||
| 		if( slide ) { | ||||
| 			// HTML5 media elements | ||||
| 			toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { | ||||
| 				if( !el.hasAttribute( 'data-ignore' ) ) { | ||||
| 				if( el.hasAttribute( 'data-autoplay' ) ) { | ||||
| 					el.play(); | ||||
| 				} | ||||
| 			} ); | ||||
|  | ||||
| 			// YouTube embeds | ||||
| 			toArray( slide.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) { | ||||
| 				if( !el.hasAttribute( 'data-ignore' ) ) { | ||||
| 				if( el.hasAttribute( 'data-autoplay' ) ) { | ||||
| 					el.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); | ||||
| 				} | ||||
| 			}); | ||||
|   | ||||
							
								
								
									
										4
									
								
								js/reveal.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								js/reveal.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
		Reference in New Issue
	
	Block a user