简体   繁体   English

在使用html5视频播放器播放视频后重定向页面

[英]redirecting the page after a video plays using an html5 video player

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. 我正在制作一个视频卷轴(投资组合)网站,使用wordpress作为我的后端,并使用videojs html5视频播放器将每个视频放在不同的帖子中。 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. 我在查看视频播放后是否触发任何DOM调用时遇到了麻烦。 Basically I want to fire the redirect as soon as the video plays. 基本上,我想在视频播放后立即触发重定向。

Can someone point me in the right direction? 有人可以指出我正确的方向吗?

Thanks! 谢谢!

you need to call a function on ended... or the relocation just there... 您需要在结束时调用一个函数...或在那儿重新定位...

That's it. 而已。

似乎有一个结束事件可以挂接到。

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;
    });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM