mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Merge pull request #2304 from TeamPiped/fix-position
Fix for calculating right position in seekbar preview
This commit is contained in:
		
						commit
						a11b99f69d
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -715,10 +715,10 @@ export default {
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        setupSeekbarPreview() {
 | 
					        setupSeekbarPreview() {
 | 
				
			||||||
            if (!this.video.previewFrames) return;
 | 
					            if (!this.video.previewFrames) return;
 | 
				
			||||||
            let seekBar = document.querySelector(".shaka-seek-bar-container");
 | 
					            let seekBar = document.querySelector(".shaka-seek-bar");
 | 
				
			||||||
            // load the thumbnail preview when the user moves over the seekbar
 | 
					            // load the thumbnail preview when the user moves over the seekbar
 | 
				
			||||||
            seekBar.addEventListener("mousemove", e => {
 | 
					            seekBar.addEventListener("mousemove", e => {
 | 
				
			||||||
                const position = (this.video.duration * e.clientX) / seekBar.clientWidth;
 | 
					                const position = (e.offsetX / e.target.offsetWidth) * this.video.duration;
 | 
				
			||||||
                this.showSeekbarPreview(position * 1000);
 | 
					                this.showSeekbarPreview(position * 1000);
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            // hide the preview when the user stops hovering the seekbar
 | 
					            // hide the preview when the user stops hovering the seekbar
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue