V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
movq
V2EX  ›  程序员

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

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

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

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

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

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