im using jwplayer with thier javascript api, im trying to detect when its the end of the video at the moment i have tried this:
onTime: function(event) {
console.log(this.getDuration());
console.log(this.getPosition());
if (this.getPosition() === this.getDuration()) {
return alert("Im done");
}
}
but this alerts twice with "im done", and obviously this is not an efficient way to detect the end of the video?
Use onComplete(callback).
onComplete: function() {
return alert("Im done");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With