LockCachingAudioSource class
This is an experimental audio source that caches the audio while it is being downloaded and played. It is not supported on platforms that do not provide access to the file system (e.g. web).
- Inheritance
-
- Object
- AudioSource
- IndexedAudioSource
- StreamAudioSource
- LockCachingAudioSource
- Annotations
-
- @experimental
Constructors
-
LockCachingAudioSource(Uri uri, {Map<
String, String> ? headers, File? cacheFile, dynamic tag}) -
Creates a LockCachingAudioSource to that provides uri to the player
while simultaneously caching it to
cacheFile
. If no cache file is supplied, just_audio will allocate a cache file internally.
Properties
-
cacheFile
→ Future<
File> -
final
-
downloadProgressStream
→ Stream<
double> -
Emits the current download progress as a double value from 0.0 (nothing
downloaded) to 1.0 (download complete).
no setter
- duration ↔ Duration?
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
→ Map<
String, String> ? -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sequence
→ List<
IndexedAudioSource> -
no setterinherited
-
shuffleIndices
→ List<
int> -
no setterinherited
- tag → dynamic
-
finalinherited
- uri → Uri
-
final
Methods
-
clearCache(
) → Future< void> - Removes the underlying cache files. It is an error to clear the cache while a download is in progress.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
request(
[int? start, int? end]) → Future< StreamAudioResponse> -
Used by the player to request a byte range of encoded audio data in small
chunks, from byte position
start
inclusive (or from the beginning of the audio data if not specified) toend
exclusive (or the end of the audio data if not specified). If the returned future completes with an error, a 500 response will be sent back to the player.override -
resolve(
) → Future< IndexedAudioSource> -
Returns a UriAudioSource resolving directly to the cache file if it
exists, otherwise returns
this
. This can be -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited