微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

播放帖子内的下一个视频

如何解决播放帖子内的下一个视频

所以我在 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 举报,一经查实,本站将立刻删除。