danikula / danikula/AndroidVideoCache

Not all videos that are being cached

オープン
#241 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。