bug fix - when the first section has a background-video, the vido do not execute. Now, it's work
This commit is contained in:
		
							
								
								
									
										17
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								js/reveal.js
									
									
									
									
									
								
							| @@ -147,6 +147,10 @@ | |||||||
| 		// Flags if reveal.js is loaded (has dispatched the 'ready' event) | 		// Flags if reveal.js is loaded (has dispatched the 'ready' event) | ||||||
| 		loaded = false, | 		loaded = false, | ||||||
|  |  | ||||||
|  | 		// Flags if video background is loaded | ||||||
|  | 		loadeddataVideo = false, | ||||||
|  |  | ||||||
|  |  | ||||||
| 		// The horizontal and vertical index of the currently active slide | 		// The horizontal and vertical index of the currently active slide | ||||||
| 		indexh, | 		indexh, | ||||||
| 		indexv, | 		indexv, | ||||||
| @@ -2472,8 +2476,17 @@ | |||||||
| 			// Start video playback | 			// Start video playback | ||||||
| 			var currentVideo = currentBackground.querySelector( 'video' ); | 			var currentVideo = currentBackground.querySelector( 'video' ); | ||||||
| 			if( currentVideo ) { | 			if( currentVideo ) { | ||||||
| 				currentVideo.currentTime = 0; |  | ||||||
| 				currentVideo.play(); | 				currentVideo.addEventListener("loadeddata", function() { | ||||||
|  | 					currentVideo.currentTime = 0; | ||||||
|  | 					currentVideo.play(); | ||||||
|  | 					loadeddataVideo = true; | ||||||
|  | 					 this.removeEventListener("loadeddata",function(){return false}); | ||||||
|  | 				}); | ||||||
|  | 				if(loadeddataVideo === true){ | ||||||
|  | 					currentVideo.currentTime = 0; | ||||||
|  | 					currentVideo.play(); | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
| 			// Don't transition between identical backgrounds. This | 			// Don't transition between identical backgrounds. This | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user