danikula / AndroidVideoCache

Cache support for any video player with help of single line
Apache License 2.0
5.43k stars 1.16k forks source link

做视频点播的同学用这个框架话要注意啦,这个框架是先缓存后播,而不是边播边缓存! #266

Open StaticCoder opened 4 years ago

StaticCoder commented 4 years ago

这个框架的原理是:将网络视频的url传给这个框架,框架返还给播放器一个file类型的uri,然后由框架直接开线程进行网络下载,播放器间接的去读取框架下载到本地的数据进行播放。 这样就会有一个很严重的问题:播放器无法控制缓冲进度! 例如,一个视频有200M,用户只看了四分之一,假设是50M,目前市面上的播放器大都有设置缓冲进度的功能,这样一来,设置将无效,框架仍然会将完整的200M视频全量下载,用户将耗费大量的数据流量,因为播放器设置的最大缓冲进度是播放器从本地读取的最大缓冲进度,而不是网络下载的进度。 Here's the above content translated automatically with Google Translate,maybe not very accurate, but still worth a look Title : Friends who do video on demand should pay attention to this framework. This framework is caching first and then playing, not caching while playing! The principle of this framework is: pass the URL of the network video to this framework, the framework returns a file type uri to the player, and then the framework directly opens the thread for network download, and the player indirectly reads the data downloaded by the framework to the local data Play. There will be a serious problem: The player cannot control the buffering progress! For example, a video has 200M, and the user only sees a quarter. Assuming it is 50M, most players on the market currently have a function to set the buffering progress. In this way, the setting will be invalid, and the frame will still complete the 200M video. For full downloads, users will consume a lot of data traffic, because the maximum buffering progress set by the player is the maximum buffering progress that the player reads locally, not the progress of the network download.

kingiis commented 4 years ago

边放边缓存,边多线程预先缓存,边蚕食用户的流量

JeffMony commented 3 years ago

确实存在这样的问题。 视频点播分为两大类,分片文件和非分片文件。 分片文件: 1.如何做边下边播 2.如何实现阻塞式代理

非分片文件: 1.如何实现流量控制 2.如何实现video range控制 3.拖动进度条如何实现。

https://juejin.cn/post/6943261875714916366

可以实现你提出的几个问题。