sampotts / plyr

A simple HTML5, YouTube and Vimeo player
https://plyr.io
MIT License
26.59k stars 2.93k forks source link

Differences in seeking causes currentTime to differ between YouTube and Vimeo #2095

Open andyov17 opened 3 years ago

andyov17 commented 3 years ago

Expected behaviour

Without first playing, seeking on a Vimeo video doesn't start playing automatically, making currentTime stay at 0. With YouTube it starts it playing, and therefore currentTime is updated (and continues to be as it plays). I have seen bugs about this inconsistency in seeking auto-playing for YouTube and not for Vimeo, but not seen any reports regarding the currentTime value not updating

Actual behaviour

Even if Vimeo doesn't start playing when seeking, currentTime should be updated when the user seeks without first playing

Steps to reproduce

https://codepen.io/andyov/pen/KKNKQNm Seeking on the first YouTube video starts playing, and currentTime is logged correctly in console. On the Vimeo version, no matter how much you seek (before actually playing), the currentTime logged in console remains at 0

Environment

Console errors (if any)

Link to where the bug is happening

spencercap commented 3 years ago

yes, this behavior is unexpected and undesired 👍

sampotts commented 3 years ago

It’s due to how their API works. We can add something in to prevent it though (I thought it was already there).

spencercap commented 3 years ago

@sampotts that would be awesome - many thanks!