Home › Forums › JavaScript › Media Events Not Working in Safari/Chrome › Reply To: Media Events Not Working in Safari/Chrome
August 9, 2013 at 2:37 pm
#146294
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!