不懂就问,有没有什么办法同时播放两个视频,并且调节视频进度是同时调节两个视频的进度

2020-12-07 16:51:58 +08:00
 movq

有个课程录播,是两个视频,一个是 ppt 界面的录屏,一个是课堂里面老师讲课的视频(只看得到黑板和人)

我下下来观看,觉得同时调节两个视频的进度很麻烦,不容易对准

有没有办法同步播放、同步调节进度

2034 次点击
所在节点    程序员
14 条回复
youla
2020-12-07 16:55:28 +08:00
做过类似的,用的 websocket 通信。
kiracyan
2020-12-07 17:02:21 +08:00
合并两个视频
ditel
2020-12-07 17:05:58 +08:00
事件吧,事件通信什么的
gggxxxx
2020-12-07 17:08:40 +08:00
40

If anyone is still interested in this the current version of VLC is able to do this very well without any kind of scripting or add-on. As far as I know however you can only play two files synchronously, not 3.

To accomplish this simply open VLC and select Media>Open Multiple Files.
Inside the multiple file windows select add to add the first file.
After this click on the, "Show more options," checkbox followed by the, "Play another media synchronously," checkbox at the bottom of the window.
Select browse next to, "Extra media," to add the second file.
Hit play and the two media files will play simultaneously with a single control window.
easonHHH
2020-12-07 17:21:25 +08:00
最简单粗暴的方法应该是找个视频剪辑软件把两个视频直接合并一起
yutou527
2020-12-07 17:44:15 +08:00
```html
<!DOCTYPE HTML>
<html>
<body>

<video id='main' controls="controls" controls="controls">
<source src="/i/movie.mp4" type="video/mp4" />
</video>
<video id='sub' controls="controls" controls="controls">
<source src="/i/movie.mp4" type="video/mp4" />
</video>

<script>
let main = document.getElementById('main');
let sub = document.getElementById('sub');
main.addEventListener('play',function(e){sub.play()}); main.addEventListener('pause',function(e){sub.pause()});
main.addEventListener('seeking',e=>{
sub.currentTime = main.currentTime;
});
</script>
</body>
</html>

```
yutou527
2020-12-07 17:44:32 +08:00
这个才简单粗暴
yutou527
2020-12-07 17:51:52 +08:00
myxingkong
2020-12-07 18:04:14 +08:00
https://imgchr.com/i/DxRCse
推荐 rvplayer,非常强大的视频播放器,支持并播多个视频,并且支持自定义播放布局,可以将一个视频叠加在另一个视频上方,看上去就像一个视频。
官网地址: http://www.tweaksoftware.com/products/rv
不过是收费的,当然你也可以找找 xx 版。
user8341
2020-12-07 18:06:56 +08:00
@yutou527 如果其中一个卡顿,另一个播放流畅会怎么样?
yutou527
2020-12-07 18:11:15 +08:00
@user8341 需要你自己优化🙃
weiwenhao
2020-12-07 18:14:48 +08:00
配置一个单独的进度条, 进度条拖动后读取百分比,然后再分别配置两个视频的进度百分比不就可以了。
movq
2020-12-07 20:36:57 +08:00
@yutou527 666👍
Lemeng
2020-12-07 21:50:34 +08:00
不专业路过,不过不会出现两个音,或者产生杂音啥的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/733002

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX