mirror of
				https://codeberg.org/ashley/poke
				synced 2025-07-17 16:52:11 +00:00 
			
		
		
		
	add jump to time v2
This commit is contained in:
		
							parent
							
								
									5f6d764965
								
							
						
					
					
						commit
						9b7c097f2e
					
				
							
								
								
									
										25
									
								
								css/app.js
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								css/app.js
									
									
									
									
									
								
							| @ -132,6 +132,31 @@ timeLinks.forEach(link => { | ||||
|   } | ||||
| }); | ||||
| 
 | ||||
| const videoPlayer = document.getElementById('video'); | ||||
| 
 | ||||
| function time(seconds) { | ||||
|   videoPlayer.currentTime = seconds; | ||||
| } | ||||
| 
 | ||||
|  document.addEventListener('click', function(event) { | ||||
|   const clickedElement = event.target;  | ||||
| 
 | ||||
|    if (clickedElement.classList.contains('comment')) { | ||||
|     const commentText = clickedElement.textContent.trim(); | ||||
| 
 | ||||
|      const timestampMatch = commentText.match(/(\d{1,2}:\d{2})/); | ||||
| 
 | ||||
|     if (timestampMatch) { | ||||
|       const timestamp = timestampMatch[0];   | ||||
|       let parts = timestamp.split(':'); | ||||
|       let seconds = (+parts[0]) * 60 + (+parts[1]);  | ||||
| 
 | ||||
|        time(seconds); | ||||
|     } | ||||
|   } | ||||
| }); | ||||
| 
 | ||||
| 
 | ||||
|    | ||||
| 
 | ||||
| // Save and resume video progress
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashley ////
						Ashley ////