Skip to content

Commit

Permalink
hakimel#1770, resume playback for paused media.
Browse files Browse the repository at this point in the history
  • Loading branch information
Markku Roponen committed Dec 12, 2016
1 parent ea661f1 commit c46d519
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/reveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
} );
Expand Down Expand Up @@ -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();
}
} );
Expand Down

0 comments on commit c46d519

Please sign in to comment.