aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAlex Batista <alexbatista.asb@gmail.com>2015-09-28 23:04:47 -0300
committerAlex Batista <alexbatista.asb@gmail.com>2015-09-28 23:04:47 -0300
commitbcfd0aae3c007d972ac380d72e79dfdd3a5d08e0 (patch)
tree2cc054e501b878ca45667e1b8b093839dfbfc17c /js
parent9a89e39367dda0d39a618c9672df59b95b7eb3a8 (diff)
downloadfosdem-2018-presentation-bcfd0aae3c007d972ac380d72e79dfdd3a5d08e0.tar
fosdem-2018-presentation-bcfd0aae3c007d972ac380d72e79dfdd3a5d08e0.tar.gz
bug fix - when the first section has a background-video, the vido do not execute. Now, it's work
Diffstat (limited to 'js')
-rw-r--r--js/reveal.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 65ac29f..ae5810c 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -147,6 +147,10 @@
// Flags if reveal.js is loaded (has dispatched the 'ready' event)
loaded = false,
+ // Flags if video background is loaded
+ loadeddataVideo = false,
+
+
// The horizontal and vertical index of the currently active slide
indexh,
indexv,
@@ -2472,8 +2476,17 @@
// Start video playback
var currentVideo = currentBackground.querySelector( 'video' );
if( currentVideo ) {
- currentVideo.currentTime = 0;
- currentVideo.play();
+
+ currentVideo.addEventListener("loadeddata", function() {
+ currentVideo.currentTime = 0;
+ currentVideo.play();
+ loadeddataVideo = true;
+ this.removeEventListener("loadeddata",function(){return false});
+ });
+ if(loadeddataVideo === true){
+ currentVideo.currentTime = 0;
+ currentVideo.play();
+ }
}
// Don't transition between identical backgrounds. This