在视频html标签中将多个文件作为一个播放 [英] play multiple files as one in video html tag

查看:37
本文介绍了在视频html标签中将多个文件作为一个播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在一个 html 播放器中播放多个视频文件,就好像它是一个文件一样.

I'm trying to play multiple video files in one html player as if it's a single file.

现在,我找到了一个脚本,可以在同一个播放器中一个接一个地播放视频:

For now, I found a script to play videos one after the other in the same player :

<video id="videoPlayer" autoplay autobuffer controls></video>

<script>
var videoPlayer = document.getElementById('videoPlayer')

var vArray = [
    "my-first-video.mp4",
    "my-second-video.mp4",
    "my-thrid-video.mp4",
]

videoPlayer.src = vArray[0]

i = 1
videoPlayer.onended = function(){
    if (i < vArray.length) {
        videoPlayer.src = vArray[i]
       i++
    }
}
</script>

问题是:

  • 每个视频之间有一个小片段

  • there is a small cut between each video

进度条不是所有视频的全局,而是每个视频的全局

the progress bar is not global for all the videos but for each one of them

关键是用户没有意识到付款人中有很多视频正在播放.

The point is that users don't realise that there are many videos playing in the payer.

我怎样才能做到这一点?是否只能使用视频 HTML 标签?或者是否有视频播放器可以做到这一点?

How can I manage to make this ? Is it possible only with the video HTML tag ? Or are there video player to do this ?

谢谢

推荐答案

我找到了另一种实现我想要做的事情的方法,我使用这个模块直接将视频与 ffmpeg 合并在一起:https://github.com/ArsalanDotMe/VideoStitch

I found another way to achieve what I wanted to do, I directly merge the videos together with ffmpeg using this module: https://github.com/ArsalanDotMe/VideoStitch

这篇关于在视频html标签中将多个文件作为一个播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆