You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to android media3 and completely lost, really appreciate if anyone can point me to the right direction, could be my code is not working as intended at all? Many thanks in advance!
The text was updated successfully, but these errors were encountered:
I think in the code sample you give above you are injecting a CacheDataSource.Factory into the DefaultMediaSourceFactory that then is used to build the player.
The DefaultMediaSourceFactory however is only used to create a MediaSource if you use the MediaItem based API like player.setMediaItem(mediaItem). If you use player.setMediaSource(mediaSource) as in your code above, then you need to make sure that the mediaSource argument has been created with the CacheDataSource.Factory as well.
From the code above I can't see how the source is constructed, but I think it may be that the source you set is still using a data source that is not wrapped by a CachedDataSource.
Can you check if caching work when you either use player.setMediaItem(mediaItem) or construct the media source with a CacheDataSource.Factory?
Thanks for the reply and the clarification! Once I correctly append the UpstreamDataSourceFactory as a HttpDataSource.Factory to my cacheFactory and use my cacheFactory to construct the mediaSource, I had caching correctly functioning and no repeated source requests.
Hi all, I'm running into an issue previously reported for exoplayer2 in 2020 with the current media3 gl demo: when I use repeat mode == Player.REPEAT_MODE_ONE, the media source is requested repeatably throughout the playback. I added in okHttpClientFactory as mentioned in the 2020 issue since it does caching, though I still saw the repeated requests.
screenshot of the repeated mediaSource requests:
I also attempted to add a cache factory to the exoplayer but couldnt see anything in the cache dir:
I'm new to android media3 and completely lost, really appreciate if anyone can point me to the right direction, could be my code is not working as intended at all? Many thanks in advance!
The text was updated successfully, but these errors were encountered: