播放帖子内的下一个视频

问题描述

所以我在 wordpress 中有一个自定义帖子类型,可以显示 html5 视频。有没有一种方法可以在下一个视频结束后自动播放并且仍然保留在同一个帖子上?我认为 this 之类的东西将是一个完美的例子。

这是我目前所拥有的 link

我有一个名为 Nowthisearth_post自定义帖子类型和一个用于拉入 MP4 文件链接自定义字段 Nowthisearth_media_url。现在有 6 个帖子,希望在视频结束后继续下一个。这就是我现在拥有的..

我开始使用 get_next_post(); 函数,但它似乎不起作用。我在想,也许需要将其转换为某种底部带有缩略图的视频播放列表。

<div class="container-fluid Nowthis-header">
<div class="container" style="z-index:11;">
    <div class="row">
        <div class="col-12">
            <?PHP $mRSSFeed_url = get_post_meta(get_the_id(),'Nowthisearth_media_url',true);?>
            <video class="Nowthis-video" style="" width="1280" height="720" autoplay="true" controls loop>
              <source src="<?PHP echo $mRSSFeed_url ?>" type="video/mp4">
                Your browser does not support the video tag.
            </video>
        </div>
        <div class="col-12">
            <?PHP $next_post = get_next_post();
            if ( is_a( $next_post,'Nowthisearth_post' ) ) : ?>
                <a href="<?PHP echo get_permalink( $next_post->ID ); ?>"><?PHP echo get_the_title( $next_post->ID ); ?></a>
            <?PHP endif; ?>
        </div>
    </div>
</div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)