Forums
Home / Plugin: Videopack / Play callback
(@andrealves)
6 years, 2 months ago
Hi.
The plugin works flawlessly but I need to hide a div when the play button is clicked. Is there a callback function so I can do this with js?
And when it ends and the thumbnail returns too.
thanks!
(@kylegilman)
Sure, that functionality is built in to the video element. You don’t need my plugin to do any of that. The event play is triggered whenever a video starts playing, and the event ended is triggered when the video reaches the end.
video
play
ended
But how do I call them? Do you have any example? Thanks
This is the basic idea. You’d add event listeners to every video on the page. https://stackoverflow.com/questions/14269241/catch-video-html5-play-stop-event