播放无中断的多部分视频(HTML5) [英] Play multi part video without interrupts (HTML5)

查看:84
本文介绍了播放无中断的多部分视频(HTML5)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将视频分割成多个部分,但要在浏览器中将其作为单个视频播放.在初始尝试中,我使用ffmpeg分割了视频,并使用onended事件播放了下一部分.缺点是它会在下一部分开始之前中断.另外,再也无法使用内置的控件进行搜索了.

I want to split a video into parts, but play it in the browser as a single video. In my inital attempt I split the video with ffmpeg and used the onended event to play the next part. The disadvantage is that it interrupts before the next part is started. Also, it's not possible anymore to use the built in controls for seeking.

因此,我想知道是否有可能将视频分成一定大小的块,始终仅加载当前块,并以某种方式避免中断.完美的解决方案是,如果我可以实现自己的以异步方式加载块的流或blob类型.

Therefore, I am wondering if it's possible to split the video into chunks of a certain size, load always only the current chunk and avoid the interrupts somehow. The perfect solution would be if I could implement my own stream or blob type which loads the chunks asynchronously.

有什么想法吗?

推荐答案

一种可能的解决方案是MediaSource API:

One possible solution is the MediaSource API: http://updates.html5rocks.com/2011/11/Stream-video-using-the-MediaSource-API Unfortunately, only Chrome supports it yet.

这篇关于播放无中断的多部分视频(HTML5)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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