mirror of
https://gitea.invidious.io/iv-org/videojs-vtt-thumbnails.git
synced 2024-08-15 00:43:16 +00:00
Further correction of X coord calculation
This commit is contained in:
parent
3d6c6709e2
commit
00251ba9de
2 changed files with 8 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "videojs-vtt-thumbnails",
|
||||
"version": "0.0.9",
|
||||
"version": "0.0.10",
|
||||
"description": "Display thumnails on progress bar hover, driven by external VTT files.",
|
||||
"main": "dist/videojs-vtt-thumbnails.cjs.js",
|
||||
"module": "dist/videojs-vtt-thumbnails.es.js",
|
||||
|
|
|
@ -188,9 +188,15 @@ class vttThumbnailsPlugin {
|
|||
this.hideThumbnailHolder()
|
||||
}
|
||||
|
||||
getXCoord(bar, mouseX) {
|
||||
const rect = bar.getBoundingClientRect();
|
||||
const docEl = document.documentElement;
|
||||
return mouseX - ( rect.left + (window.pageXOffset || docEl.scrollLeft || 0));
|
||||
}
|
||||
|
||||
onBarMousemove (event) {
|
||||
this.updateThumbnailStyle(
|
||||
event.clientX - (this.progressBar.offsetLeft + this.player.el().offsetLeft),
|
||||
this.getXCoord(this.progressBar, event.clientX),
|
||||
this.progressBar.offsetWidth
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue