From 7ce0c0fcc08c63691cbf5c45b05a33520c796133 Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Mon, 17 Apr 2023 00:00:32 +0100 Subject: [PATCH] Fix for calculating right position in seekbar preview --- src/components/VideoPlayer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/VideoPlayer.vue b/src/components/VideoPlayer.vue index 2fbf51ae..4f07d2d8 100644 --- a/src/components/VideoPlayer.vue +++ b/src/components/VideoPlayer.vue @@ -718,7 +718,7 @@ export default { let seekBar = document.querySelector(".shaka-seek-bar-container"); // 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