-1

I have a JWPlayer playing video in a page, when people accidentally click a link in that page or the F5 button, the player will stop playing automatically and start to redirect to other page. I use below function to help viewer to make sure this action is not made accidentally, but this could not keep the player continue playing, so is there any solution?

window.onbeforeunload=function(){...};
Jason
  • 303
  • 1
  • 5
  • 13
  • onbeforeunload will just fire to alert user that you are redirecting but not stop the page to redirect – Ismail Farooq Mar 29 '16 at 05:41
  • Below code can stop the redirect, but could not stop the player stopping.$(window).bind('beforeunload', function () { return 'are you sure blablabla'; }); – Jason Apr 05 '16 at 05:46

1 Answers1

0

The best solution would be to update a cookie with the player's position on reload, then do seek on('ready') with that value. I don't think you can continue video play when a page is reloaded, but this would give the impression of continuous play.

Josie Keller
  • 477
  • 2
  • 8
  • People may not happy with the cut of playing, that's why I want to find a way to fix this – Jason Apr 05 '16 at 05:46