From 962c6c133b0860b5ad4d99d9fb36eca625de5b7a Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Tue, 13 Dec 2016 16:02:26 +0200 Subject: [PATCH] #1770, set 'data-paused-by-reveal' attribute only for the media elements, which are not already in paused state. --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index c8ce5a2e..6781639c 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3071,7 +3071,7 @@ if( slide && slide.parentNode ) { // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { + if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' && el.paused === false ) { el.setAttribute('data-paused-by-reveal', ''); el.pause(); }