-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with .seek() for Youtube videos #714
Comments
Neither of the links start playing in my tests (with you code). Rather, the loading animation is showing in a constant loop. This makes sense since the data hasn't loaded. I don't consider this to be a bug, but perhaps I misunderstood? To load the current time you can play, then pause, like this: You may also want hide/black out the container until it's loaded (and likely mute/unmute). Also see #426 for a feature suggestion related to this issue. |
#709 use this methode |
RIght. I found that there is no issue if the script is running on the server. But if you run it with no server -> it there. https://www.youtube.com/watch?v=D9YZw_X5UzQ starts to play on seek. Any idea why? Previously (before last updates) we do not have this issue. Just run Thanks for the answer. But this issue is already fixed. Isn't it? |
That's strange. Can confirm that this is happening to the top video if opening the file directly in Chrome (but not Firefox). Perhaps some sort of race-condition involved. Seems to be very edge-case. I would try to avoid opening html files like that. Self-hosting isn't hard. At least for devs (try pythons SimpleHTTPServer or Caddy). Due to security reasons, opening html files in your browser isn't the same experience as if they were hosted. Still strange though. In case that doesn't work for you, this worked for me opening directly in Chrome plyr.setup('.vid').forEach(plr => {
plr.pause(); // Pausing here _shouldn't_ be necessary, but is
plr.on('ready', () => {
plr.toggleMute(true);
plr.seek(10);
plr.play();
});
plr.on('playing', () => {
if (!plr.seekDone) {
plr.pause();
plr.toggleMute(false);
plr.seekDone = true;
}
});
}); |
For me on Firefox same issue (v.57) Most of the youtube videos have this bug. Anyway. Today moved dev. env. to a self-hosted server and no issue. And thank you for the code snippet! Won't close the issue. Maybe someday it will be fixed. |
I can't seem to replicate this on v3 so assuming it's fixed? Feel free to re-open if that's not the case 👍 |
Expected behavior
The video is paused (just loaded). When
seek()
to some point in the video it should not start to play.Actual behavior
seek()
should work with respect to the current plyr state. But it starts to play.But the worst that for some videos it works as expected (f.e. this one https://www.youtube.com/watch?v=ZqqZSuKrY-U ) but for some not (i.e. this one https://www.youtube.com/watch?v=D9YZw_X5UzQ )
Environment
Players affected:
Steps to reproduce
Use code below
The text was updated successfully, but these errors were encountered: