question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How does Exoplayer identify cached Item?

See original GitHub issue

When filing a question:

Fill out the sections below, leaving the headers but replacing the content. If you’re unable to provide certain information, please explain why in the relevant section. We may close issues if they do not include sufficient information.

[REQUIRED] Searched documentation and issues

Not Sure if one exists.

[REQUIRED] Question

How do i make exoplayer play already cached content if the URI has changed. The URI of the content in our app changes everytime the tracks are fetched and this causes the cached content to recached since i believe the uri is the identifier as i noticed that while implementing download feature.

Is there a way out of this or a solution.

links to the Different Uri which points to the same file has been emailed with issue #6046

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mathemandycommented, Jul 4, 2019

After several iterations and thoughts i noticed since it was an HLS file every segment requires it own key. Passing the same key used for downloading the file for the segments (which was what was happening earlier when i tried to set my custom cacheKey) made it loop on buffering.

I was able to solve this by making different keys for all the Segments as they had their own URI’s

0reactions
mathemandycommented, Jun 19, 2019

My issue is that the player doesnt play the item, its stuck in Buffering mode, thats the last state thats Logged.

I expect when i used a custom cachekey, the player plays the song

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using cache in ExoPlayer - android - Stack Overflow
Here is the solution for ExoPlayer 2.+. Create a custom cache data source factory public class CacheDataSourceFactory implements DataSource.
Read more >
Video preloading/ precaching using Exoplayer 2 in Android
ProgressListener : This is used for listening to updated about the current state of caching. It will give us the cached data length,...
Read more >
Cache (ExoPlayer library)
A resource is a complete piece of logical data, for example a complete media file. A cache key uniquely identifies a resource. URIs...
Read more >
Preloading and Buffering Videos in Android with ExoPlayer
The first function preCacheVideo takes in a video URL and passes it into a DataSpec which defines a region of data in a...
Read more >
Media streaming with ExoPlayer - Android Developers
ExoPlayer is an app-level media player built on top of low-level media APIs in Android. It is an open source project used by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found