danikula / danikula/AndroidVideoCache

Not all videos that are being cached

Abierto
#241 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Java
Estrellas
5.5k
Forks
1.2k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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?

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.