From 8cb3c279b0beac5de1ef9f5bc1fdbadfe1187002 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 28 Oct 2013 08:45:14 -0400 Subject: don't autoplay videos in notes window #624 --- js/reveal.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'js/reveal.js') diff --git a/js/reveal.js b/js/reveal.js index cc93aa8..e7debb5 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2009,7 +2009,7 @@ var Reveal = (function(){ */ function startEmbeddedContent( slide ) { - if( slide ) { + if( slide && !isSpeakerNotes() ) { // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { if( el.hasAttribute( 'data-autoplay' ) ) { @@ -2061,6 +2061,16 @@ var Reveal = (function(){ } + /** + * Checks if this presentation is running inside of the + * speaker notes window. + */ + function isSpeakerNotes() { + + return !!window.location.search.match( /receiver/gi ); + + } + /** * Reads the current URL (hash) and navigates accordingly. */ -- cgit v1.2.3