mirror of
https://github.com/iv-org/videojs-vtt-thumbnails.git
synced 2025-04-23 00:19:23 -04:00
Further correction of X coord calculation
This commit is contained in:
parent
3d6c6709e2
commit
00251ba9de
@ -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…
x
Reference in New Issue
Block a user