OdyseeTeam / odysee-frontend

The code that runs odysee.com
https://odysee.com
MIT License
215 stars 68 forks source link

Fix attempt - Issue #2895 #3045

Closed keikari closed 9 months ago

keikari commented 9 months ago

Fixes

Issue Number: #2895

New behavior: -queue pauses playing on end of the last video -the second item from the queue doesn't start playing in middle of other playlists

Seems that a second onVideoEnded function gets attached to the player, when a second queue item is added. (Doesn't happen with following video adds)
And one of those sticked around, and got called when not wanted. (I didn't quite understood how this exactly worked.)

Clearing onEndeds before adding a new one, seems to fix the behavior. Also clearing them didn't seem to break anything. Looping and shuffle also kept working the same than before.

keikari commented 9 months ago

I'm not quite sure what the lint wants. The error doesn't seem to be related to my changes?

infinite-persistence commented 8 months ago

I think adding the off definition to the Player type should fix all the lint issues

Edit: Update the second parameter to optional. https://docs.videojs.com/player#off It's somewhat a valid complaint -- not providing the second parameter removes all registered handlers. That may or may not be what we want at times, but seems fine for this case.