From 6831f6c17415c6c20269f3d61e673482442319b6 Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Mon, 12 Dec 2016 16:30:07 +0200 Subject: [PATCH] #1770, resume playback for paused media. --- js/reveal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 2c929545..9594255f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3016,7 +3016,8 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( el.hasAttribute( 'data-autoplay' ) && typeof el.play === 'function' ) { + if( ( el.hasAttribute( 'data-autoplay' ) || el.hasAttribute( 'data-paused-by-reveal' ) ) && typeof el.play === 'function' ) { + el.removeAttribute('data-paused-by-reveal'); el.play(); } } ); @@ -3071,6 +3072,7 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { + el.addAttribute('data-paused-by-reveal'); el.pause(); } } );