ryanheise
ryanheise
Looking at the Nginx documentation, it seems to offer two different approaches for byte-range caching: https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/ 1. Cache lock: Downloads the entire file on the initial request. During the download,...
I see no reason why both Nginx caching approaches can't be implemented, with an additional option in the cache slicing approach to automatically download all segments. As for caching radio...
I think the cache logic could be abstracted out into a separate class with a subclass for each caching strategy. These could be plugged into the same caching subclass of...
I just tried making a simple implementation that subclasses `StreamAudioSource` and realised that the `lengthInBytes`cannot be a synchronous getter, so I'm going to rework the API. I'll post a sample...
The latest commit fixes the `StreamAudioSource` API and also provides a `LockCachingAudioSource` subclass which implements a very simple approach to caching where the first request results in the file being...
Just FYI, how to try out the above caching implementation: ```dart player.setAudioSource(LockCachingAudioSource( uri: Uri.parse('https://............mp3'), )); ``` In addition to `uri`, there are parameters for `headers` and `cacheFile` so you can...
@zxl777 what behaviour would you like when Wi-Fi is turned off while the resource is being downloaded? I think if it's turned off after the download is complete, there should...
The source code for LockCachingAudioSource is not too mysterious, hopefully, so feel free to improve its behaviour as desired. One of the planned improvements for this caching strategy was to...
One easy way to experiment with this is to copy the code for `LockCachingAudioSource` into your own project and modify it as desired. It is built using entirely public APIs...
The latest commit on `master` now supports seeking during the download. If you seek to a region that has already been downloaded, it will be fulfilled from the cache. If...