diff --git a/js/reveal.js b/js/reveal.js
index b229453..04350d0 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -2001,7 +2001,7 @@ var Reveal = (function(){
}
if( includeAll || h === indexh ) {
- toArray( backgroundh.childNodes ).forEach( function( backgroundv, v ) {
+ toArray( backgroundh.querySelectorAll( 'section' ) ).forEach( function( backgroundv, v ) {
if( v < indexv ) {
backgroundv.className = 'slide-background past';
@@ -2021,9 +2021,22 @@ var Reveal = (function(){
} );
- // Don't transition between identical backgrounds. This
- // prevents unwanted flicker.
+ // Stop any currently playing video background
+ if( previousBackground ) {
+
+ var previousVideo = previousBackground.querySelector( 'video' );
+ if( previousVideo ) previousVideo.pause();
+
+ }
+
if( currentBackground ) {
+
+ // Start video playback
+ var currentVideo = currentBackground.querySelector( 'video' );
+ if( currentVideo ) currentVideo.play();
+
+ // Don't transition between identical backgrounds. This
+ // prevents unwanted flicker.
var previousBackgroundHash = previousBackground ? previousBackground.getAttribute( 'data-background-hash' ) : null;
var currentBackgroundHash = currentBackground.getAttribute( 'data-background-hash' );
if( currentBackgroundHash && currentBackgroundHash === previousBackgroundHash && currentBackground !== previousBackground ) {
@@ -2031,6 +2044,7 @@ var Reveal = (function(){
}
previousBackground = currentBackground;
+
}
// Allow the first background to apply without transition
diff --git a/js/reveal.min.js b/js/reveal.min.js
index 89ea604..3c481bc 100644
--- a/js/reveal.min.js
+++ b/js/reveal.min.js
@@ -1,9 +1,9 @@
/*!
- * reveal.js 2.7.0-dev (2014-04-03, 11:56)
+ * reveal.js 2.7.0-dev (2014-04-04, 09:21)
* http://lab.hakim.se/reveal-js
* MIT licensed
*
* Copyright (C) 2014 Hakim El Hattab, http://hakim.se
*/
-var Reveal=function(){"use strict";function a(a){if(b(),!mc.transforms2d&&!mc.transforms3d)return document.body.setAttribute("class","no-transforms"),void 0;window.addEventListener("load",C,!1);var d=Reveal.getQueryHash();"undefined"!=typeof d.dependencies&&delete d.dependencies,l(hc,a),l(hc,d),t(),c()}function b(){mc.transforms3d="WebkitPerspective"in document.body.style||"MozPerspective"in document.body.style||"msPerspective"in document.body.style||"OPerspective"in document.body.style||"perspective"in document.body.style,mc.transforms2d="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style,mc.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,mc.requestAnimationFrame="function"==typeof mc.requestAnimationFrameMethod,mc.canvas=!!document.createElement("canvas").getContext,bc=navigator.userAgent.match(/(iphone|ipod|android)/gi)}function c(){function a(){e.length&&head.js.apply(null,e),d()}function b(b){head.ready(b.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],function(){"function"==typeof b.callback&&b.callback.apply(this),0===--f&&a()})}for(var c=[],e=[],f=0,g=0,h=hc.dependencies.length;h>g;g++){var i=hc.dependencies[g];(!i.condition||i.condition())&&(i.async?e.push(i.src):c.push(i.src),b(i))}c.length?(f=c.length,head.js.apply(null,c)):a()}function d(){e(),U(),i(),hb(),_(!0),setTimeout(function(){lc.slides.classList.remove("no-transition"),ic=!0,v("ready",{indexh:Yb,indexv:Zb,currentSlide:_b})},1)}function e(){lc.theme=document.querySelector("#theme"),lc.wrapper=document.querySelector(".reveal"),lc.slides=document.querySelector(".reveal .slides"),lc.slides.classList.add("no-transition"),lc.background=f(lc.wrapper,"div","backgrounds",null),lc.progress=f(lc.wrapper,"div","progress",""),lc.progressbar=lc.progress.querySelector("span"),f(lc.wrapper,"aside","controls",'
'),lc.slideNumber=f(lc.wrapper,"div","slide-number",""),f(lc.wrapper,"div","state-background",null),f(lc.wrapper,"div","pause-overlay",null),lc.controls=document.querySelector(".reveal .controls"),lc.controlsLeft=m(document.querySelectorAll(".navigate-left")),lc.controlsRight=m(document.querySelectorAll(".navigate-right")),lc.controlsUp=m(document.querySelectorAll(".navigate-up")),lc.controlsDown=m(document.querySelectorAll(".navigate-down")),lc.controlsPrev=m(document.querySelectorAll(".navigate-prev")),lc.controlsNext=m(document.querySelectorAll(".navigate-next"))}function f(a,b,c,d){var e=a.querySelector("."+c);return e||(e=document.createElement(b),e.classList.add(c),null!==d&&(e.innerHTML=d),a.appendChild(e)),e}function g(){s()&&document.body.classList.add("print-pdf"),lc.background.innerHTML="",lc.background.classList.add("no-transition"),m(document.querySelectorAll(ec)).forEach(function(a){var b;b=s()?h(a,a):h(a,lc.background),m(a.querySelectorAll("section")).forEach(function(a){s()?h(a,a):h(a,b)})}),hc.parallaxBackgroundImage?(lc.background.style.backgroundImage='url("'+hc.parallaxBackgroundImage+'")',lc.background.style.backgroundSize=hc.parallaxBackgroundSize,setTimeout(function(){lc.wrapper.classList.add("has-parallax-background")},1)):(lc.background.style.backgroundImage="",lc.wrapper.classList.remove("has-parallax-background"))}function h(a,b){var c={background:a.getAttribute("data-background"),backgroundSize:a.getAttribute("data-background-size"),backgroundImage:a.getAttribute("data-background-image"),backgroundVideo:a.getAttribute("data-background-video"),backgroundColor:a.getAttribute("data-background-color"),backgroundRepeat:a.getAttribute("data-background-repeat"),backgroundPosition:a.getAttribute("data-background-position"),backgroundTransition:a.getAttribute("data-background-transition")},d=document.createElement("div");if(d.className="slide-background",c.background&&(/^(http|file|\/\/)/gi.test(c.background)||/\.(svg|png|jpg|jpeg|gif|bmp)$/gi.test(c.background)?d.style.backgroundImage="url("+c.background+")":d.style.background=c.background),(c.background||c.backgroundColor||c.backgroundImage||c.backgroundVideo)&&d.setAttribute("data-background-hash",c.background+c.backgroundSize+c.backgroundImage+c.backgroundVideo+c.backgroundColor+c.backgroundRepeat+c.backgroundPosition+c.backgroundTransition),c.backgroundSize&&(d.style.backgroundSize=c.backgroundSize),c.backgroundImage&&(d.style.backgroundImage='url("'+c.backgroundImage+'")'),c.backgroundColor&&(d.style.backgroundColor=c.backgroundColor),c.backgroundRepeat&&(d.style.backgroundRepeat=c.backgroundRepeat),c.backgroundPosition&&(d.style.backgroundPosition=c.backgroundPosition),c.backgroundTransition&&d.setAttribute("data-background-transition",c.backgroundTransition),c.backgroundVideo){var e=document.createElement("video");c.backgroundVideo.split(",").forEach(function(a){e.innerHTML+='