V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
movq
V2EX  ›  程序员

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

  •  
  •   movq · 2020-12-07 16:51:58 +08:00 · 2019 次点击
    这是一个创建于 1240 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

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

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

    14 条回复    2020-12-07 21:50:34 +08:00
    youla
        1
    youla  
       2020-12-07 16:55:28 +08:00
    做过类似的,用的 websocket 通信。
    kiracyan
        2
    kiracyan  
       2020-12-07 17:02:21 +08:00
    合并两个视频
    ditel
        3
    ditel  
       2020-12-07 17:05:58 +08:00 via Android
    事件吧,事件通信什么的
    gggxxxx
        4
    gggxxxx  
       2020-12-07 17:08:40 +08:00   ❤️ 1
    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
        5
    easonHHH  
       2020-12-07 17:21:25 +08:00
    最简单粗暴的方法应该是找个视频剪辑软件把两个视频直接合并一起
    yutou527
        6
    yutou527  
       2020-12-07 17:44:15 +08:00   ❤️ 3
    ```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
        7
    yutou527  
       2020-12-07 17:44:32 +08:00
    这个才简单粗暴
    yutou527
        8
    yutou527  
       2020-12-07 17:51:52 +08:00
    myxingkong
        9
    myxingkong  
       2020-12-07 18:04:14 +08:00   ❤️ 1
    https://imgchr.com/i/DxRCse
    推荐 rvplayer,非常强大的视频播放器,支持并播多个视频,并且支持自定义播放布局,可以将一个视频叠加在另一个视频上方,看上去就像一个视频。
    官网地址: http://www.tweaksoftware.com/products/rv
    不过是收费的,当然你也可以找找 xx 版。
    user8341
        10
    user8341  
       2020-12-07 18:06:56 +08:00
    @yutou527 如果其中一个卡顿,另一个播放流畅会怎么样?
    yutou527
        11
    yutou527  
       2020-12-07 18:11:15 +08:00
    @user8341 需要你自己优化🙃
    weiwenhao
        12
    weiwenhao  
       2020-12-07 18:14:48 +08:00
    配置一个单独的进度条, 进度条拖动后读取百分比,然后再分别配置两个视频的进度百分比不就可以了。
    movq
        13
    movq  
    OP
       2020-12-07 20:36:57 +08:00
    @yutou527 666👍
    Lemeng
        14
    Lemeng  
       2020-12-07 21:50:34 +08:00
    不专业路过,不过不会出现两个音,或者产生杂音啥的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2223 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 02:23 · PVG 10:23 · LAX 19:23 · JFK 22:23
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.