1

I am making a video reel (a portfolio) website, using wordpress as my backend, and the videojs html5 video player with each video in a different post. I want the videos to play successively, so that when one video finishes it redirects to the "next post".

I'm having trouble seeing if there are any DOM calls that fire after the video plays. Basically I want to fire the redirect as soon as the video plays.

Can someone point me in the right direction?

Thanks!

goddamnyouryan
  • 6,854
  • 15
  • 56
  • 105

3 Answers3

1

you need to call a function on ended... or the relocation just there...

That's it.

la_antorcha
  • 378
  • 5
  • 9
0

It looks like there is an ended event that you can hook up to.

Andy Gaskell
  • 31,495
  • 6
  • 74
  • 83
0

Ended up using the following code:

$(document).ready(function(){
    var sStr = "<?php echo get_permalink(get_adjacent_post(true,'',true)); ?>";
    $(".video-js").bind('ended', function(){
                window.location = sStr;
    });
});
goddamnyouryan
  • 6,854
  • 15
  • 56
  • 105