Skip to content

Commit

Permalink
don't start video bgs if autoPlayMedia config is set to false
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Mar 11, 2024
1 parent 76ec60a commit 62b1ea3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions js/controllers/backgrounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ export default class Backgrounds {
*/
update( includeAll = false ) {

let config = this.Reveal.getConfig();
let currentSlide = this.Reveal.getCurrentSlide();
let indices = this.Reveal.getIndices();

let currentBackground = null;

// Reverse past/future classes when in RTL mode
let horizontalPast = this.Reveal.getConfig().rtl ? 'future' : 'past',
horizontalFuture = this.Reveal.getConfig().rtl ? 'past' : 'future';
let horizontalPast = config.rtl ? 'future' : 'past',
horizontalFuture = config.rtl ? 'past' : 'future';

// Update the classes of all backgrounds to match the
// states of their slides (past/present/future)
Expand Down Expand Up @@ -373,8 +374,9 @@ export default class Backgrounds {
previousVideoParent.appendChild( currentVideo );
currentVideoParent.appendChild( previousVideo );

// Resume playing if the previous video was playing
previousVideo.play();
if( config.autoPlayMedia !== false ) {
previousVideo.play();
}
}
}
}
Expand Down

0 comments on commit 62b1ea3

Please sign in to comment.