From 8bbc2971acafafdb6194efe372663d8ec59b6f0a Mon Sep 17 00:00:00 2001 From: Razvan Caliman Date: Sat, 19 Sep 2015 15:31:49 +0100 Subject: [PATCH] add option to mute background videos --- README.md | 22 +++++++++++----------- js/reveal.js | 5 +++++ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index d86c984..91da8f6 100644 --- a/README.md +++ b/README.md @@ -445,8 +445,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.

@@ -499,15 +499,15 @@ You can also use different in and out transitions for the same slide: ```html
- The train goes on … + The train goes on …
-
- and on … +
+ and on …
-
+
and stops.
-
+
(Passengers entering and leaving)
@@ -813,7 +813,7 @@ The multiplex plugin needs the following 3 things to operate: More details: #### Master presentation -Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation: +Served from a static file server accessible (preferably) only to the presenter. This need only be on your (the presenter's) computer. (It's safer to run the master presentation from your own computer, so if the venue's Internet goes down it doesn't stop the show.) An example would be to execute the following commands in the directory of your master presentation: 1. ```npm install node-static``` 2. ```static``` @@ -886,7 +886,7 @@ You are very welcome to point your presentations at the Socket.io server running ##### socket.io server as file static server -The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs.jit.su](http://revealjs.jit.su). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match.) +The socket.io server can play the role of static file server for your client presentation, as in the example at [http://revealjs.jit.su](http://revealjs.jit.su). (Open [http://revealjs.jit.su](http://revealjs.jit.su) in two browsers. Navigate through the slides on one, and the other will update to match.) Example configuration: ```javascript @@ -938,7 +938,7 @@ Reveal.initialize({ If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies). -The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value. +The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the ```math``` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the ```mathjax``` configuration value. Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the ```math``` config object at all. @@ -951,7 +951,7 @@ Reveal.initialize({ mathjax: 'http://cdn.mathjax.org/mathjax/latest/MathJax.js', config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html }, - + dependencies: [ { src: 'plugin/math/math.js', async: true } ] diff --git a/js/reveal.js b/js/reveal.js index a768d68..f6b2c19 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -2812,6 +2812,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 @@ -2826,6 +2827,10 @@ video.setAttribute( 'loop', '' ); } + if( backgroundVideoMuted ) { + video.muted = true; + } + // Support comma separated lists of video sources backgroundVideo.split( ',' ).forEach( function( source ) { video.innerHTML += '';