videojs / videojs-youtube

YouTube playback technology for Video.js
1.12k stars 548 forks source link

onended function not working on YouTube embed #603

Closed HeadStudios closed 1 year ago

HeadStudios commented 1 year ago

I am unable to get the onended function to work when a YouTube video completes playing - please comment on any potential troubleshooting steps to take or investigate - please find complete code for my page in the Gist below for reference:

https://gist.github.com/HeadStudios/22334b73f2f293a5d98f9f333c8c7871

Thank you!

mister-ben commented 1 year ago

As you've commented in the gist, you need to use the Video.js API player.on('ended', fn)