From b49664621f2a4ecb683a952e4dee86be2258453f Mon Sep 17 00:00:00 2001 From: Razvan Caliman Date: Thu, 3 Dec 2015 09:43:32 +0000 Subject: [PATCH] add option to mute background videos (updated) --- README.md | 4 ++-- js/reveal.js | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf604773..01f01dc9 100644 --- a/README.md +++ b/README.md @@ -448,8 +448,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 will loop when the data-background-video-loop attribute is provided.

+
+

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

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 da1a60ae..e25337e0 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2873,6 +2873,7 @@ var backgroundImage = slide.getAttribute( 'data-background-image' ), backgroundVideo = slide.getAttribute( 'data-background-video' ), backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), + backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ), backgroundIframe = slide.getAttribute( 'data-background-iframe' ); // Images @@ -2887,6 +2888,10 @@ video.setAttribute( 'loop', '' ); } + if( backgroundVideoMuted ) { + video.muted = true; + } + // Support comma separated lists of video sources backgroundVideo.split( ',' ).forEach( function( source ) { video.innerHTML += '';