I'm using the streaming_audio_flutter_demo project on Github. https://github.com/suragch/streaming_audio_flutter_demo
This has a class that provides a ValueListenableBuilder and a slider along with play and pause controls for my app.
The only problem is, I'd like to change the example URL to my own;
static const url = 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3';
But I'm not sure how to pass it to the class from the main page of my app. Here's the code for the PageManager class;
class PageManager {
final progressNotifier = ValueNotifier<ProgressBarState>(
ProgressBarState(
current: Duration.zero,
buffered: Duration.zero,
total: Duration.zero,
),
);
final buttonNotifier = ValueNotifier<ButtonState>(ButtonState.paused);
late AudioPlayer _audioPlayer;
static const url = 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3';
PageManager() {
_init();
}
void _init() async {
// initialize the song
_audioPlayer = AudioPlayer();
await _audioPlayer.setUrl(url);
}
}
The String I need to pass looks like this;
_current?.path
So how can I access the
static const url = 'https://www.soundhelix.com/examples/mp3/SoundHelix-Song-2.mp3';
from the main page of my app?