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

#146199
g3logic
Participant

Looks like you’re using jQuery. Try using bind() to handle your video events. I have found that adding event listeners in JS for audio/video events can be wonky sometimes.

Try this (note – omit the [0] in the video reference when working with video events):

var v = $('#video');
v.bind('playing', function() {
    alert("Video has started");
});

    v.bind('ended', function() {
    alert("Video has ended");
});