danikula / danikula/AndroidVideoCache
Not all videos that are being cached
- Vorherrschende Sprache
- Java
- Sterne
- 5.5k
- Forks
- 1.2k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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?
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, java
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100