• 请不要在回答技术问题时复制粘贴 AI 生成的内容
movq
V2EX  ›  程序员

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

  •  
  •   movq · Dec 7, 2020 · 3014 views
    This topic created in 2157 days ago, the information mentioned may be changed or developed.

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

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

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

    14 replies  •  2020-12-07 21:50:34 +08:00
    youla
    youla
    Dec 7, 2020
    1
    做过类似的,用的 websocket 通信。
    kiracyan
    kiracyan
    Dec 7, 2020
    2
    合并两个视频
    ditel
    ditel
    Dec 7, 2020 via Android
    3
    事件吧,事件通信什么的
    gggxxxx
    gggxxxx
    Dec 7, 2020❤️1
    4
    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
    easonHHH
    Dec 7, 2020
    5
    最简单粗暴的方法应该是找个视频剪辑软件把两个视频直接合并一起
    yutou527
    yutou527
    Dec 7, 2020❤️3
    6
    ```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
    yutou527
    Dec 7, 2020
    7
    这个才简单粗暴
    myxingkong
    myxingkong
    Dec 7, 2020❤️1
    9
    https://imgchr.com/i/DxRCse
    推荐 rvplayer,非常强大的视频播放器,支持并播多个视频,并且支持自定义播放布局,可以将一个视频叠加在另一个视频上方,看上去就像一个视频。
    官网地址: http://www.tweaksoftware.com/products/rv
    不过是收费的,当然你也可以找找 xx 版。
    9LCRwvU14033RHJo
    9LCRwvU14033RHJo
    Dec 7, 2020
    10
    @yutou527 如果其中一个卡顿,另一个播放流畅会怎么样?
    yutou527
    yutou527
    Dec 7, 2020
    11
    @user8341 需要你自己优化🙃
    weiwenhao
    weiwenhao
    Dec 7, 2020
    12
    配置一个单独的进度条, 进度条拖动后读取百分比,然后再分别配置两个视频的进度百分比不就可以了。
    movq
    movq
    OP
    Dec 7, 2020
    13
    @yutou527 666👍
    Lemeng
    Lemeng
    Dec 7, 2020
    14
    不专业路过,不过不会出现两个音,或者产生杂音啥的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5127 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 47ms · UTC 01:19 · PVG 09:19 · LAX 17:19 · JFK 20:19
    ♥ Do have faith in what you're doing.