0

I'm having trouble auto-redirecting after my video has ended using BigVideo.js. Not sure what's wrong here. Not only does this not redirect it completely breaks the player and the video does not play.

    <script type="text/javascript">
  var BV;
  $(function() {
    // initialize BigVideo
    BV = new $.BigVideo();
    BV.init();
    BV.show('vids/video.mp4');
     BV.getPlayer().on("ended", function() {
window.location = "http://www.google.com";
    })
    });
</script>
Yu Hao
  • 119,891
  • 44
  • 235
  • 294

1 Answers1

1

I tested your code locally and the redirection worked without any problems. I guess it depends on the browser type/version or other environment factor.

Try to properly unload the video element by:

BV.getPlayer().on("ended", function () {
    this.pause();
    delete(this);
    window.location = "http://www.google.com";
});

reference: How to properly unload/destroy a VIDEO element

hope that will do the trick :)

Community
  • 1
  • 1
Tomer Sela
  • 481
  • 9
  • 16