tweak implementation of #1376
This commit is contained in:
		
							
								
								
									
										14
									
								
								js/reveal.js
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								js/reveal.js
									
									
									
									
									
								
							@@ -2728,8 +2728,20 @@
 | 
				
			|||||||
			// Start video playback
 | 
								// Start video playback
 | 
				
			||||||
			var currentVideo = currentBackground.querySelector( 'video' );
 | 
								var currentVideo = currentBackground.querySelector( 'video' );
 | 
				
			||||||
			if( currentVideo ) {
 | 
								if( currentVideo ) {
 | 
				
			||||||
				if( currentVideo.currentTime > 0 ) currentVideo.currentTime = 0;
 | 
					
 | 
				
			||||||
 | 
									var startVideo = function() {
 | 
				
			||||||
 | 
										currentVideo.currentTime = 0;
 | 
				
			||||||
					currentVideo.play();
 | 
										currentVideo.play();
 | 
				
			||||||
 | 
										currentVideo.removeEventListener( 'loadeddata', startVideo );
 | 
				
			||||||
 | 
									};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if( currentVideo.readyState > 1 ) {
 | 
				
			||||||
 | 
										startVideo();
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									else {
 | 
				
			||||||
 | 
										currentVideo.addEventListener( 'loadeddata', startVideo );
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			var backgroundImageURL = currentBackground.style.backgroundImage || '';
 | 
								var backgroundImageURL = currentBackground.style.backgroundImage || '';
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user