-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
Add ResolvingAudioSource; #800
base: minor
Are you sure you want to change the base?
Conversation
@ryanheise OK! First, thank you and this great project, this project has helped me a lot!Also, I just didn't understand StreamAudioSource before, and it's really a good idea to implement it. I will modify it. |
@cooaer A modified version of the example from the PR 779 works quite well. final apiService = ApiService();
final queue = await apiService.getQueue();
final resolvingAudioSource = [
for (final queueItem in queue)
ResolvingAudioSource(
uniqueId: queueItem["id"],
resolveSoundUrl: ((uniqueId) async {
uniqueId = queueItem["id"];
return Uri.parse(await apiService.getUrl(queueItem));
}
}),
tag: queueItem),
];
_playlist.addAll(resolvingAudioSource);
await _audioPlayer.setAudioSource(_playlist); Also I don't know if it was intentional or a typo, but the parameter of |
Not working with youtube video urls. @shuyec @ryanheise |
It's not supposed to. |
Does this work on ios and mac? |
From the PR ryanheise#800
I tried on IOS and it doesn't seem to work audioSource = ResolvingAudioSource(uniqueId: audioId,
resolveSoundUrl: (audioId) async {
final manifest = (await _yt.videos.streamsClient
.getManifest(audioId));
final audioUri = Platform.isIOS ? manifest.muxed.withHighestBitrate().url
: manifest.audioOnly.withHighestBitrate().url;
return audioUri;
}, tag: tag); |
Resolve url in time with headers;