Jason Schot Jason Schot -4 years ago 292
Javascript Question

ended event videojs not working

I would like to trigger a simple event when my video is finished. I've placed this directly bellow my video tag.

<script type="text/javascript">
var myPlayer = videojs("session_video");
this.addEvent("ended", function(){
alert('Here I am');

However I get: TypeError: this.addEvent is not a function and I can't find why.

You can see it live here: (stackoverflow won't allow to make that a link)
enter code 01-01-01-2012 to bring up the video.

Any insight is much apricaited!

Kind regards,

Answer Source

"addEvent" and "removeEvent" were replaced by "on" and "off"


this.on("ended", function(){ 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download