Listen on the actual seekbar to calculate

This commit is contained in:
Kavin 2023-04-17 00:05:06 +01:00 committed by GitHub
parent 7ce0c0fcc0
commit 974324fad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -715,7 +715,7 @@ export default {
},
setupSeekbarPreview() {
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
seekBar.addEventListener("mousemove", e => {
const position = (e.offsetX / e.target.offsetWidth) * this.video.duration;