I'm creating a elearning for selling video courses. Using Wordpress and Woocommerce with Sesei plugin. The videos are on Youtube and it intact to the site with iframe. The users get the course divided into video lessons. I need that every time a user ends up seeing a video lesson reached me an email. How can I do? I can use some javascript with bees youtube? I also need that we can not see the next lesson without having seen the previous lesson? Can I change something in the Sensei jquery plugins?
Thanks
Here is the API that you can use for call the iframe api in JS.
https://developers.google.com/youtube/iframe_api_reference#Events
You can use onStateChange for track video has been ended. Your code will look this
In this code onPlayerStateChange is a function. You can do whatever you want to do once video has been ended.