When I hover over the timeline on a YouTube video, I see the time code pop up in a tooltip. If I click on that spot in the timeline, the video should seek to the time code being displayed in the tooltip.
The time code displayed in the seek tooltip is not the same one that the video actually seeks to. It is inconsistent and off by approximately 15-20 seconds every time.
Hopefully this can be reproduced, I've noticed it on multiple machines. Thank you for your hard work, this is a great library!
I'm not getting this with the plyr demo (https://plyr.io/#youtube) with Chrome 66 on a Mac. Are you getting the issue on the demo?
Correction: It's happening on the demo as well.
It might be happening but you can't tell because the "current time" block isn't visible.
If you use the custom HTML controls option (https://github.com/sampotts/plyr/blob/master/controls.md), which has the current time visible by default, its more obvious
You can click the time (after pressing play or seeking) in order to show the current time instead of the remaining time. Anyway, you're right, and It's happening on the demo too. My head was just too deep into another task in order to test this properly.
Thanks 馃憤
Wow, that's cool, I had no idea! Thanks for your help
I think it's a rounding error. The diff gets bigger the further to the right you click, and it's happening for html5 and vimeo too.
That makes sense, I first started noticing it on really long videos (1hr+)
The cause of this is the <input type="range"> and my calculation of the value for the tooltip. The issue is that the handle never overlaps the end of the track on the input so you need to know the width of the handle itself and account for a varying amount of that as you get closer to the extremities. Unfortunately you can't determine the width of the handle with JavaScript as it's in the shadow DOM. I wonder if it's possible to do by creating an offscreen <input type="range"> that has width: 0 then calculate the rendered width. I'll take another look. Someone else raised a similar bug.
Fixed in v3.3.8
Most helpful comment
The cause of this is the
<input type="range">and my calculation of the value for the tooltip. The issue is that the handle never overlaps the end of the track on the input so you need to know the width of the handle itself and account for a varying amount of that as you get closer to the extremities. Unfortunately you can't determine the width of the handle with JavaScript as it's in the shadow DOM. I wonder if it's possible to do by creating an offscreen<input type="range">that haswidth: 0then calculate the rendered width. I'll take another look. Someone else raised a similar bug.