Collection of extension function of just_audio package for auto-handle caching

Overview

just_audio_cache

pub package

Collection of extension function of just_audio package for auto-handle caching audio files

How to use

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();
You might also like...

BC Image Editor - Flutter package for image editing

BC Image Editor - Flutter package for image editing

BC Image Editor You can edit image using this package and also you can create flex preview image by setting foreground to null. For now, you can use o

Nov 21, 2022

This is a flutter package of video player. it's a very simple and easy to use.

This is a flutter package of video player. it's a very simple and easy to use.

This is a flutter package of video player. it's a very simple and easy to use.

Nov 18, 2022

Dart package for reading and writing wav files

wav Simple tools for reading and writing WAV files. Written in pure Dart, with no dependencies. This package currently supports reading and writing 8/

Dec 28, 2022

Libwinmedia implementation of just_audio.

just_audio_libwinmedia The libwinmedia implementation of [just_audio][https://github.com/ryanheise/just_audio]. Installation Add the just_audio_libwin

Oct 22, 2022

Just_audio: a feature-rich audio player for Android, iOS, macOS and web

Just_audio: a feature-rich audio player for Android, iOS, macOS and web

just_audio just_audio is a feature-rich audio player for Android, iOS, macOS and web. Mixing and matching audio plugins The flutter plugin ecosystem c

Jun 28, 2022

Superpowers for Dart. Collection of useful static extension methods.

If you miss an extension, please open an issue or pull request Resources: Documentation Pub Package GitHub Repository On this page you can find some o

Jan 8, 2023

A kotlin-style extension collection for dart.

Collection of extensions Dart is good but can be better. Kotlin Style Join QQ Group now: 1003811176 For objects: let run also takeIf takeUnless For st

Nov 2, 2022

This package helps you daily usable function and ready-made Widgets with ease.

This package helps you daily usable function and ready-made Widgets with ease.

Show some love and like to support the project Documentation API Docs are available. Platform Support Android iOS MacOS Web Linux Windows ✔️ ✔️ ✔️ ✔️

Dec 23, 2022

Flutter shareable package of object-oriented classes for local caching of user data in json

Flutter shareable package of object-oriented classes for local caching of user data in json

json_cache Json Cache is an object-oriented package to serve as a layer on top of local storage packages - packages that persist data locally on the u

Dec 19, 2022

Stories like in Instagram, each story can include multiple images and videos. Package supports video, titles, preliminary caching.

Stories like in Instagram, each story can include multiple images and videos. Package supports video, titles, preliminary caching.

flutter_instagram_stories A Flutter package for displaying stories just like Whatsapp & Instagram. Built-in groups (multiple stories with one icon), c

Dec 9, 2022

Dart package for Async Data Loading and Caching. Combine local (DB, cache) and network data simply and safely.

Dart package for Async Data Loading and Caching. Combine local (DB, cache) and network data simply and safely.

Stock is a dart package for loading data from both remote and local sources. It is inspired by the Store Kotlin library.

Dec 24, 2022

A code generator to write widgets as function without loosing the benefits of classes.

Widgets are cool. But classes are quite verbose: class Foo extends StatelessWidget { final int value; final int value2; const Foo({Key key, thi

Dec 29, 2022

An isolated worker for Flutter (Isolate) and Web (Web Worker). Behaves almost the same as the compute function, except it is not a one-off worker.

A singleton isolated worker for all platforms. On most platforms, it uses Flutter's Isolate, except on the web, since Isolate is not available, it use

Nov 11, 2022

FaaS (Function as a service) framework for writing portable Dart functions

Functions Framework for Dart This is a community-supported project, meaning there is no official level of support. The code is not covered by any SLA

Dec 26, 2022

A ecommerce app created in flutter implementing the features add to cart, total ,add, remove item and a login function

catalog A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Nov 27, 2021

CRUD Table Flutter consists of a Lazy loading function, resizable columns, and integrated CRUD Form.

CRUD Table Flutter consists of a Lazy loading function, resizable columns, and integrated CRUD Form.

CRUD Table Flutter CRUD Table Flutter is a package for crating CURD-UI for your entity/object/class easily. It consists of a Lazy loading function, re

Dec 31, 2022

Flutter-sorted-chips-row - Flutter library for rendering a row of Material "Chip" buttons that gets sorted according to the given function

Flutter-sorted-chips-row - Flutter library for rendering a row of Material

sorted_chips_row A Flutter Widget displaying a row of Material Chips, sorted according to the provided comparison function. How to use Adding dependen

Jul 29, 2021

Flutter's compute function made available for all non-Flutter Dart programs

compute Flutter's compute function made available for all non-Flutter Dart programs The compute package takes Flutter's compute function and makes it

Nov 10, 2022

FlutterAgoraFirebaseVideoCall (Agora RTC, Bloc Pattern, Cubit, Firestore, Cloud Function, FCM)

FlutterAgoraFirebaseVideoCall (Agora RTC, Bloc Pattern, Cubit, Firestore, Cloud Function, FCM)

Flutter Agora Fully Functional Video Call module Tech Stack Client: Dart, Flutter Server: Firebase firestore, Google cloud functions Techniques: *BloC

Dec 16, 2022
Comments
  • Using PlayList with just_audio_cache

    Using PlayList with just_audio_cache

    Hello, i use this plugin to build my audio book player for a blind users community. is it pocible to use the playlist dataSource with caching support? thanks.

    opened by voipworld 5
  • (-1002) unsupported URL when calling dynamicSet() method

    (-1002) unsupported URL when calling dynamicSet() method

    I have audio to play but unable to cache it on iphone 8 (15.6.1)

    https://myerecordstudiobucket.s3.amazonaws.com/HighRatedGabruGuruRandhawa582292_40_903700_13.mp3

    simple steps to reproduce issue

    try{ String audioUrl ="https://myerecordstudiobucket.s3.amazonaws.com/HighRatedGabruGuruRandhawa582292_40_903700_13.mp3"; await audioPlayer.dynamicSet(url: audioUrl)

    ///----> it thowing error } catch (e) { print("catch set url audio-------------- ${e.toString()}"); }

    ---------------------- output ---------------- catch set url audio-------------- (-1002) unsupported URL

    -------------- flutter doctor-------

    flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.10.0, on macOS 12.4 21F79 darwin-x64, locale en-IN) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 13.2.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] Connected device (3 available) [✓] HTTP Host Availability

    • No issues found!

    opened by vishalvishvakarma1111 2
  • Offline listening

    Offline listening

    I want use your plugin for caching audio and listening them offline. Could I do it?

    I added this plugin in my project. Called dynamicSet() method. After what I turn off internet on the device and try listen audio(play() method) and got exaption TYPE_SOURCE: java.net.UnknownHostException: Unable to resolve host ": No address associated with hostname

    opened by emahota-flo 2
Releases(0.1.0)
Owner
Yoda
Software Engineer
Yoda
A flutter plugin to handle Android / iOS camera

?? Overview Flutter plugin to add Camera support inside your project. CamerAwesome include a lot of useful features like: ?? Live camera flip ( switch

Apparence.io 511 Jan 5, 2023
Flutter video trimmer package

A Flutter package for trimming videos Features Customizable video trimmer Video playback control Retrieving and storing video file Also, supports conv

Souvik Biswas 349 Jan 3, 2023
Enhanced pub package commands.

Enhanced pub package commands. Add latest resolvable package Remove dependency View package info Like/unlike/view liked pub.dev packages Improved conf

Leo Farias 14 Oct 19, 2022
A flutter package for iOS and Android for applying filter to an image

Photo Filters package for flutter A flutter package for iOS and Android for applying filter to an image. A set of preset filters are also available. Y

Ansh rathod 1 Oct 26, 2021
Flutter package for creating a fully customizable and editable image widget.

EditableImage Flutter Package Flutter package for creating a fully customizable and editable image widget. The package has been written solely in Dart

Bulent Baris Kilic 5 Jun 13, 2022
A lightweight flutter package to simplify the creation of a miniplayer.

A lightweight flutter package to simplify the creation of a miniplayer by providing a builder function with the current height and percentage progress

David Peters 80 Dec 18, 2022
A small image utils package for flutter written in dart.

flutter_simple_image_utils A small image utils package for flutter written in dart. Usage: import 'package:flutter_simple_image_utils/flutter_simple_i

Hamlet D'Arcy 1 Nov 18, 2021
A Flutter package for both android and iOS which provides Audio recorder

social_media_recorder A Flutter package for both android and iOS which provides

subhikhalifeh 16 Dec 29, 2022
Image Extensions A wrapper library for image package with some extra functions.

A wrapper library for image package with some extra functions. Installation Add this to your package's pubspec.yaml file: dependencie

Vanxh 1 Jan 15, 2022
Audio classification Tflite package for flutter (iOS & Android).

Audio classification Tflite package for flutter (iOS & Android). Can also support Google Teachable Machine models.

Michael Nguyen 47 Dec 1, 2022