stephenscaff / vimeo-playlists

A js lib using the Vimeo Player API to create a nonstop playlist of Vimeo Vids.
MIT License
16 stars 7 forks source link

loading next video not working when player window is not visible #25

Open georgeb2222 opened 1 year ago

georgeb2222 commented 1 year ago

Hi Stephen ! thank you for your work !

there is an issue loading the next video when the playilst is playing and you scroll down to the bottom of your demo page and player window is not visible. the player gets stuck with the video end cards/screen. you have to reload the whole page.

thx

georgeb2222 commented 11 months ago

is there any solution to fix this? thank you

DerekBuntin commented 11 months ago

Hi Stephen ! thank you for your work !

there is an issue loading the next video when the playilst is playing and you scroll down to the bottom of your demo page and player window is not visible. the player gets stuck with the video end cards/screen. you have to reload the whole page.

thx

@georgeb2222 this seems to be an issue only with the demo as an error is being generated with one of the files:

DOMException: Failed to read the 'buffered' property from 'SourceBuffer': This SourceBuffer has been removed from the parent media source.

Have you encountered this issue too?

georgeb2222 commented 11 months ago

yes I ahve encounter the issue with a new list of videos.

stephenscaff commented 10 months ago

whewwww. Late on this one. Sorry ya'll. Let me see what's up.

stephenscaff commented 10 months ago

So, here's what I see, in Chrome.

If player is not visible, once a video ends, the API loads next vid, but the end screen overlaps. It seems to still be playing though.

If I set muted: false I can hear the next vid's audio. With debug: true I can see the next vid load and start.

But, the end screen is overlapping the video.

This issue seems related

Can ya'll confirm a similar experience?

stephenscaff commented 10 months ago

Okay... think i have a sorta solution for this.

I'd rather simply rely on the onEnded event to load next vid, as seemingly designed by the Vimeo Player API. However, that issue i mentioned above has existed since 2022, so perhaps we need to get creative for now.

In testing, I can rely on onTimeupdate to detect right before vid ends, perhaps 1 or 0.3 sec, then call next().

This seems to work. Just wondering if we should make it an option - ie: useTimeudate? Or, simply replace onEnded?

Will report back once i publish something.