diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 2fbf51ae..3a873be8 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -715,10 +715,10 @@ 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 = (this.video.duration * e.clientX) / seekBar.clientWidth; + const position = (e.offsetX / e.target.offsetWidth) * this.video.duration; this.showSeekbarPreview(position * 1000); }); // hide the preview when the user stops hovering the seekbar