diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-05-06 11:28:21 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2015-05-06 11:28:21 +0200 |
commit | d14727b40747a032fe6f5aec89afea03e4bbb9cb (patch) | |
tree | 469dfa24404eda3c8de5604f05116daa5505c2d8 /js | |
parent | 207b0c71ede4a37ec06797802c22e7c5d61346f6 (diff) | |
download | perl-software-in-gnu-guix-d14727b40747a032fe6f5aec89afea03e4bbb9cb.tar perl-software-in-gnu-guix-d14727b40747a032fe6f5aec89afea03e4bbb9cb.tar.gz |
type check to ensure we don't call media api before media has loaded
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index ecba3a9..7619005 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2904,7 +2904,7 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( el.hasAttribute( 'data-autoplay' ) ) { + if( el.hasAttribute( 'data-autoplay' ) && typeof el.play === 'function' ) { el.play(); } } ); @@ -2945,7 +2945,7 @@ if( slide && slide.parentNode ) { // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) ) { + if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { el.pause(); } } ); |