Interaction when a video is ended

Hey there.
I’m building a website which contains a lot of videos from Youtube.
Is there a way to use an animation when a video is ended?
I saw there was the javascript onended() function but I’m not able to use it for my website atm, because I don’t understand how to.
Can someone help me on this please?
Thank you for your time.
Best.

Please read the guidelines Posting Guidelines for the Code Help Category - Custom code - Forum | Webflow

and share your published URL and public share link (both are different).