Просмотр исходного кода

dont restart background video when it hasn't changed (fixes #3633)

Hakim El Hattab 1 месяц назад
Родитель
Сommit
2ac0566941
6 измененных файлов с 5 добавлено и 3 удалено
  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. 1 1
      js/config.js
  6. 4 2
      js/controllers/backgrounds.js

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/reveal.esm.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/reveal.esm.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/reveal.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
dist/reveal.js.map


+ 1 - 1
js/config.js

@@ -77,7 +77,7 @@ export default {
 	// Enable keyboard shortcuts for navigation
 	keyboard: true,
 
-	// Optional function that blocks keyboard events when retuning false
+	// Optional function that blocks keyboard events when returning false
 	//
 	// If you set this to 'focused', we will only capture keyboard events
 	// for embedded decks when they are in focus

+ 4 - 2
js/controllers/backgrounds.js

@@ -358,15 +358,17 @@ export default class Backgrounds {
 
 		}
 
+		const backgroundChanged = currentBackground !== this.previousBackground;
+
 		// Stop content inside of previous backgrounds
-		if( this.previousBackground ) {
+		if( backgroundChanged && this.previousBackground ) {
 
 			this.Reveal.slideContent.stopEmbeddedContent( this.previousBackground, { unloadIframes: !this.Reveal.slideContent.shouldPreload( this.previousBackground ) } );
 
 		}
 
 		// Start content in the current background
-		if( currentBackground ) {
+		if( backgroundChanged && currentBackground ) {
 
 			this.Reveal.slideContent.startEmbeddedContent( currentBackground );
 

Некоторые файлы не были показаны из-за большого количества измененных файлов