fix homepage videos skipping when buffering
This commit is contained in:
		
							parent
							
								
									4cd0be67b4
								
							
						
					
					
						commit
						d69d331138
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
					@ -86,7 +86,11 @@ const videos = [
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for (const video of videos) {
 | 
					  for (const video of videos) {
 | 
				
			||||||
    observer.observe(video);
 | 
					    observer.observe(video);
 | 
				
			||||||
    video.addEventListener("ended", nextVideo)
 | 
					
 | 
				
			||||||
 | 
					    video.addEventListener("ended", () => {
 | 
				
			||||||
 | 
					      // The "ended" event might just mean its buffering.
 | 
				
			||||||
 | 
					      if (video.duration !== 0 && video.currentTime === video.duration) nextVideo();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  const onVisibilityChange = () => {
 | 
					  const onVisibilityChange = () => {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue