brightcove / videojs-thumbnails

A video.js plugin that displays thumbnail images over the scrubber.
Other
168 stars 97 forks source link

Clicking on the progressControl causes screws up the order of thumbnails #3

Closed jgubman closed 10 years ago

jgubman commented 11 years ago

Looks like when you click on the progress control, the event.offsetX on line 72 gets reset to 0 and that screws up the active variable on line 78 (resets it back to 0), so your ordering gets all screwy.

jgubman commented 11 years ago

changing line 72 to:

    // apply updated styles to the thumbnail if necessary
    var relativeX = (event.pageX - $(this).parent().offset().left);
    mouseTime = Math.floor(relativeX / progressControl.width() * duration);

fixes the resetting of the thumbnail sequence for me (on Chrome).

gkatsev commented 10 years ago

I think this is actually because when you click, the seekhandle of videojs moves to where you clicked and for some reason, when you're over the seekhandle, the values reported are wrong.

gkatsev commented 10 years ago

Guessing that offsetX is inside the element the mouse is currently in, which in this case, it's the seek handle.