Added support for postMessage's into any iframes for content that needs to do somethi...
authorBrad Gessler <brad@polleverywhere.com>
Sun, 27 Oct 2013 03:31:42 +0000 (20:31 -0700)
committerBrad Gessler <brad@polleverywhere.com>
Sun, 27 Oct 2013 19:18:08 +0000 (12:18 -0700)
js/reveal.js

index a1ae5e4aa55b4c54bdba30bf59d6634c8e685c0e..7bc84dea2d374450c448f6d3851d93aa968376bc 100644 (file)
@@ -2017,6 +2017,11 @@ var Reveal = (function(){
                                }
                        } );
 
+                       // iframe embeds
+                       toArray( slide.querySelectorAll( 'iframe' ) ).forEach( function( el ) {
+                               el.contentWindow.postMessage('slide:start', '*');
+                       });
+
                        // YouTube embeds
                        toArray( slide.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) {
                                if( el.hasAttribute( 'data-autoplay' ) ) {
@@ -2041,6 +2046,11 @@ var Reveal = (function(){
                                }
                        } );
 
+                       // iframe embeds
+                       toArray( slide.querySelectorAll( 'iframe' ) ).forEach( function( el ) {
+                               el.contentWindow.postMessage('slide:stop', '*');
+                       });
+
                        // YouTube embeds
                        toArray( slide.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) {
                                if( !el.hasAttribute( 'data-ignore' ) && typeof el.contentWindow.postMessage === 'function' ) {