aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--js/reveal.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/js/reveal.js b/js/reveal.js
index ce5c2b6..5b4a545 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2472,20 +2472,19 @@
if( currentBackground ) {
- // Start video playback
- var currentVideo = currentBackground.querySelector( 'video' );
- if( currentVideo ) {
-
- currentVideo.addEventListener("loadeddata", function() {
+ // Start video playback
+ var currentVideo = currentBackground.querySelector( 'video' );
+ if( currentVideo ) {
+ if(currentVideo.readyState >1){
currentVideo.currentTime = 0;
currentVideo.play();
- loadeddataVideo = true;
- this.removeEventListener("loadeddata",function(){return false});
- });
-
- if(loadeddataVideo === true){
+ }
+ else{
+ currentVideo.addEventListener("loadeddata", function() {
currentVideo.currentTime = 0;
currentVideo.play();
+ currentVideo.removeEventListener("loadeddata",function(){return false});
+ });
}
}