Andres Andres -4 years ago 92
Javascript Question

What's the play event on a video html5 element?

I have a video html5 tag embedded on page. I need to trigger an action when the user clicks the "Play Button". But I can't find how to bind that to my action. Is there an event for what I need? I'm using jQuery...


Answer Source

Does this W3C demo page help? It appears the play event is simply 'play'.

For example:

$('video').bind('play', function (e) {
    // do something


$('video').on('play', function (e) {
    // do something
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download