diff --git a/README.md b/README.md index 31dc903..c83e406 100644 --- a/README.md +++ b/README.md @@ -431,8 +431,8 @@ Slides are contained within a limited portion of the screen by default to allow

This background image will be sized to 100px and repeated.

-
-

Video. Multiple sources can be defined using a comma separated list.

+
+

Video. Multiple sources can be defined using a comma separated list. Video will loop when the data-background-video-loop attribute is provided.

Embeds a web page as a background. Note that the page won't be interactive.

diff --git a/js/reveal.js b/js/reveal.js index d5294e6..7d3973e 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2756,6 +2756,7 @@ var backgroundImage = slide.getAttribute( 'data-background-image' ), backgroundVideo = slide.getAttribute( 'data-background-video' ), + backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), backgroundIframe = slide.getAttribute( 'data-background-iframe' ); // Images @@ -2765,6 +2766,9 @@ // Videos else if ( backgroundVideo && !isSpeakerNotes() ) { var video = document.createElement( 'video' ); + if ( backgroundVideoLoop ) { + video.setAttribute( 'loop', '' ); + } // Support comma separated lists of video sources backgroundVideo.split( ',' ).forEach( function( source ) {