In video-js how to create a custom event?

Viewed 4443

I need to create a custom event in video JS that fires at a certain point during the play back.

For example:

player.on('timeupdate',function(){
    if(player.currentTime> 50){
        // trigger some custom event like 'played50Second'
    }
});

and then later I want to do:

player.on('played50Second',function(evt){
    console.log('Great Job, you played 50 second of the video!!!')
});

How can I achieve that?

1 Answers
Related