danikula / danikula/AndroidVideoCache
Not all videos that are being cached
- 主要语言
- Java
- 星标
- 5.5k
- 派生
- 1.2k
- PR 合并指标
- 30 天内没有已合并 PR
描述
I have a list of videos which is try to cache but somehow only the first few videos are being cached.
urls.map {
proxy.registerCacheListener(listener, it)
uriList.add(Uri.parse(proxy.getProxyUrl(it)))
}
val mediaSource = createConcatenatedMediaSource(uriList)
player.prepare(mediaSource, true, false)
This is how the proxyCache Server is being created in the Application file
HttpProxyCacheServer.Builder(this)
.maxCacheSize(1024 * 1024 * 1024)
.cacheDirectory(VideoCacheUtils.getVideoCacheDir(this))
.build()
Here is how I create the media source
private fun createConcatenatedMediaSource(uriList: List): MediaSource {
val mediaList: ArrayList = ArrayList()
uriList.map {
mediaList.add(createMediaSource(it))
}
return ConcatenatingMediaSource(*mediaList.toTypedArray())
}
private fun createMediaSource(uri: Uri): MediaSource {
val bandwidthMeter = DefaultBandwidthMeter()
val dataSourceFactory = DefaultDataSourceFactory(context, Util.getUserAgent(context, "exoplayer-videos"), bandwidthMeter)
return ExtractorMediaSource.Factory(dataSourceFactory).createMediaSource(uri)
}
And here is how i create the exo player
val videoTrackSelectionFactory = AdaptiveTrackSelection.Factory()
val trackSelector = DefaultTrackSelector(videoTrackSelectionFactory)
player = ExoPlayerFactory.newSimpleInstance(context,
DefaultRenderersFactory(context),
trackSelector,
DefaultLoadControl())
I checked the mediaSource. All of the videos are in the list.
**I tried making the cache size bigger but that didn't fix the problem.**
**I tried making the cache size smaller to see if fewer videos will be cached, the number didn't change. SO obviously even 512 MB is enough for the videos that are being cached. Why would 1GB not be enough for the rest of it.**
How do I increase the number of videos cached?
贡献指南
这个仓库没有索引到贡献指南
调研方向
Start at the Application file's HttpProxyCacheServer.Builder setup, then trace createConcatenatedMediaSource and createMediaSource alongside the proxy.registerCacheListener calls. Reproduce the behavior with the listed ExoPlayer setup and inspect the listener and cache-directory results; done when the cause of the uncached videos is identified and the requested caching behavior is verified.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, java
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100