
If Paused, Pause OnSeek, If Playing, Keep Playing OnSeek
I'm stuck. I've figured out a way (finally) to get the player to respect the user has the video already paused when they seek, but now it pauses even when the user attempts to seek while playing.
playerInstance.on('pause', function(e){
delete realstate;
realstate = "paused";
});
playerInstance.on('seek', function(e){
var newoffset = e.offset;
//playerInstance.seek(newoffset);
var pstate = playerInstance.getState();
if(realstate == 'paused') {
playerInstance.pause(true);
}
console.log(newoffset +' '+ realstate);
});
I would have loved to add...
playerInstance.on('play', function(e){
delete realstate;
realstate = "playing";
});
But "play" event gets launched immediately with the Seek event, so it will cause the video to play after seek no matter what.
Any solution? JW7
Thanks
Ryan