Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Media Events Not Working in Safari/Chrome Reply To: Media Events Not Working in Safari/Chrome

#146294
realph
Participant

It seemed to be a problem with the HTML5 Player I was using (SublimeVideo) as I tried it on CodePen and it worked perfectly.

http://codepen.io/realph/pen/rfmdz

So, instead of using native .addEventListener‘s, I’m using Sublime’s API and have managed to get it working.

sublime.ready(function(){
    var player = sublime.player('the-video');

    sublime.player('the-video').on({
      start: function(player) { alert("Video has started") },
      end:   function(player) { alert("Video has ended"); }
    });
});

P.S. I probably should have mentioned I was using Sublime in the beginning.

Thanks for all the help @g3logic!