New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Offline listening #2
Comments
Yes, you can do that. First, get the local downloaded audio file ( make sure to check if the file exists first) const path = await player.getCachedPath(url: your_remote_url); Then play the file await player.playFromFile(filePath: path); |
A lot of thanks! |
Hi. I have a question. What is the
And here:
Also, can you have an example to cache many audio files? Should we do it with for loop? My data is created like this: import 'package:just_audio/just_audio.dart';
import 'package:just_audio_background/just_audio_background.dart';
final ConcatenatingAudioSource audiosPlaylist = ConcatenatingAudioSource(
children: [
AudioSource.uri(
Uri.parse('https://cdn.pixabay.com/download/audio/2023/03/25/audio_4bc265ac9f.mp3'),
tag: MediaItem(
id: '0',
title: "Ar-Rahiq Al-Maxtum",
artist: "Safiyyurrahmon Muborakfuriy",
artUri: Uri.parse(
'https://img.youtube.com/vi/g-oht-ECif0/maxresdefault.jpg'),
),
),
AudioSource.uri(
Uri.parse('https://sakiyna.com/ar-rahiq-al-maxtum/0-qism.mp3'),
tag: MediaItem(
id: '1',
title: "Ar-Rahiq Al-Maxtum",
artist: "Safiyyurrahmon Muborakfuriy",
artUri: Uri.parse(
'https://img.youtube.com/vi/g-oht-ECif0/maxresdefault.jpg'),
),
),
],
); And I want to use it with Please give full examples. |
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 exaptionTYPE_SOURCE: java.net.UnknownHostException: Unable to resolve host ": No address associated with hostname
The text was updated successfully, but these errors were encountered: