Tweaking Caching to achieve desired behaviour.
Open
Nobody has claimed this yet.
question
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Context: App operates on small progressive m4a files from server. (3-10mb range)
- App already has a mapping logic to convert a URL -> File Path on local device where file will be saved.
Current Logic:
- Start the playback with url while caching it, as normal.
- by default when using SimpleCache with data source, exoplayer prduces files named 1.xxx.v3.exo in cache directory
- Simple Cache Sink was constructed using
.setFragmentSize(C.LENGTH_UNSET)to disable fragmentation.
- Simple Cache Sink was constructed using
- rest as per documentation.
Behaviour Needed:
- Having a CacheSource which can:
-
- Start Playback using URL from server while caching it into said mapped local file path (single m4a file is needed).
-
- when mediaItem is again played it can check if above
file.exists()if it does, load that else do step a.
- when mediaItem is again played it can check if above
-
Compromises acceptable:
- File is played from network and cached as in fragments as is done now, but after completion it should be saved into the said file by reading into it.
- and when done, next time player should always use above saved file if it exists.
will appreciate any help / pointing me to the right direction.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.