Bladeren bron

don't start video bgs if autoPlayMedia config is set to false

Hakim El Hattab 1 jaar geleden
bovenliggende
commit
62b1ea302c
5 gewijzigde bestanden met toevoegingen van 6 en 4 verwijderingen
  1. 0 0
      dist/reveal.esm.js
  2. 0 0
      dist/reveal.esm.js.map
  3. 0 0
      dist/reveal.js
  4. 0 0
      dist/reveal.js.map
  5. 6 4
      js/controllers/backgrounds.js

File diff suppressed because it is too large
+ 0 - 0
dist/reveal.esm.js


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.esm.js.map


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.js


File diff suppressed because it is too large
+ 0 - 0
dist/reveal.js.map


+ 6 - 4
js/controllers/backgrounds.js

@@ -268,14 +268,15 @@ export default class Backgrounds {
 	 */
 	 */
 	update( includeAll = false ) {
 	update( includeAll = false ) {
 
 
+		let config = this.Reveal.getConfig();
 		let currentSlide = this.Reveal.getCurrentSlide();
 		let currentSlide = this.Reveal.getCurrentSlide();
 		let indices = this.Reveal.getIndices();
 		let indices = this.Reveal.getIndices();
 
 
 		let currentBackground = null;
 		let currentBackground = null;
 
 
 		// Reverse past/future classes when in RTL mode
 		// 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
 		// Update the classes of all backgrounds to match the
 		// states of their slides (past/present/future)
 		// states of their slides (past/present/future)
@@ -373,8 +374,9 @@ export default class Backgrounds {
 						previousVideoParent.appendChild( currentVideo );
 						previousVideoParent.appendChild( currentVideo );
 						currentVideoParent.appendChild( previousVideo );
 						currentVideoParent.appendChild( previousVideo );
 
 
-						// Resume playing if the previous video was playing
-						previousVideo.play();
+						if( config.autoPlayMedia !== false ) {
+							previousVideo.play();
+						}
 					}
 					}
 				}
 				}
 			}
 			}

Some files were not shown because too many files changed in this diff