From 06d0579610b6e041f68842ece1c481476df52f6d Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Sat, 27 Apr 2013 18:36:29 -0400 Subject: only auto-play media when data-autoplay is set (#388) --- js/reveal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/reveal.js') diff --git a/js/reveal.js b/js/reveal.js index 82a0741..4f4373d 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -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":""}', '*'); } }); -- cgit v1.2.3