Im using jwplayer to handle the videos on my site, but having difficulty figuring out how to fire an event on a certain percentage of the video.
This is my current code:
jwplayer("myElement").setup({
file: "video.mp4",
height: 600,
width: 600,
events: {
onComplete: function() {
alert("hi!");
}
}
});
which fires an event only on complete. I want to fire the even when the video hits 80 percent completion.
Any tips?
lenght
of the video andcurrent
time thenprogress
= current time X lenght / 100 whene progress >=80 fire your fine