
JWPlayer 7.5 oncomplete change to -1 second and don't show image
Hello everyone,
I have a video playing and in the end, when it's all through and on state "complete" I would like it to go back 1 second and stop there - not showing the poster, just the video at this point.
I have tried
on('time', function(timing) {
var currentPosition = timing.position;
var lengthOfVideo = timing.duration;
if((currentPosition >= lengthOfVideo-1 && currentPosition < lengthOfVideo))
{
__globalCounter = 1;
__globalTiming = timing;
__globalComplete = true;
}
};
with a check in
on('complete', function() {
if (__globalComplete)
{
__player.seek(__globalTiming.position);
__player.play(false);
__player.pause(true);
}
};
This ends in an infinite loop and I really have no idea why - I am still new to this whole topic though. So every help would be appreciated :)