just_audio_cache
[just_audio](https://pub.dev/packages/just_audio) 패키지의 확장 함수 모음으로 오디오 파일 캐싱을 자동으로 처리합니다
캐싱을 자동으로 처리하기 위한 just_audio 패키지의 확장 함수 모음
{"sdk":"flutter"}^0.9.11^2.0.6^2.0.2^1.1.0{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
Collection of extension function of just_audio package for auto-handle caching audio files
The premise is you already have just_audio package in your dependency
Core method dynamicSet would auto handle caching, if the target file not in cache, would download it and push in cache.
The next time the same url request call, would call the local file instead of requesting.
url is your audio source, a unique key that represents the stored file path,
pushIfNotExisted if true, when the file not exists, would download the file and push in cache
excludeCallback a callback function where you can specify which file you don't want to be cached
import 'package:just_audio_cache/just_audio_cache.dart';
void _play() async {
// dynamic set your audio source
await _player.dynamicSet(your_url);
_player.play();
}
If you want to check if the target file exist in cache
_player.existedInLocal(your_url);
Manually add file to cache
_player.cacheFile(your_audio_url);
Get Cached file for the following url
_player.getCachedFile(url: your_url);
Clear all the cache from storage
_player.clear();