"Replaying" Vidstack YouTube player causes video to buffer indefinitely
Current Behavior:
When I replay the vidstack player with a YouTube video via button on the bottom left, the video plays initially but then seems to stop buffering permanently. This is reproducible.
I notice the player dispatches a waiting event but nothing seems to happen afterwards.
Expected Behavior:
The video should buffer normally, just as it does when playing a YouTube video for the first time.
Steps To Reproduce:
- Refresh your page and visit the demo link here
- Play the video from the beginning and then skip to near the end as quickly as possible. Wait until you see the "Pause" icon turn into the "Replay" icon
- Click "Replay"
- Wait a few moments. The video starts normally, but then it stops and buffers indefinitely. Controls become unresponsive - trying to pause / unpause does not help. The point where this happens changes based on how much video you buffered when you originally played it prior to replay.
Environment:
Listing out my own environment here just in case it's helpful:
- Version: "0.6.15" (on my own device) but also occurring on "1.12.8"
- Framework: React
- Browser: Chrome@127
- OS: MacOS Sonomo 14.5
Anything Else?
Resolved by #1393.
Hey @mihar-22 , I just installed the latest build via @vidstack/[email protected] (and have verified that I'm using the latest version in my node_modules with the commit that fixed #1393 ).
However, the issue here doesn't seem to have been resolved. I can still reproduce this issue consistently. Is there anything I can do to support with debugging?
I'll double check when I can but it worked on my few tests.
I can see the issue and I confirmed it's happening on the embed side and not in our player. Not sure how to resolve this at the moment.
@mihar-22 Hey, not sure if it's exactly the same issue, but it's easy to reproduce even on demo site: here
Before starting the video initially, press rapidly several times (let's say 3 subsequent clicks in a row) on a "play" button (like you're impatient while it's initially loading). This will cause player to load indefinitely while blocking all controls at the same time. You can still switch and scrub the timeline and even see the video jumps to the selected time, but it won't ever play again normally. Maybe some bug to look for.
This is a workaround to the restart issue. Add an event listener on video end event and set it there
player.addEventListener('ended', () => {
player.clipStartTime = 0.01;
});