-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
AudioService.addToQueue generates exception: "This session doesn't support queue management operations". #9
Comments
I've just published release 0.0.9 which should now support queue/playlist management. Just an important point about the way it works, this will only be enabled if you implement one or more of the queue callbacks passed into |
Thank you very much for the help! I have tried the new update, and I could sort of get it to work. However, I am running into trouble when I try to queue items immediately after starting the audio service. Currently, awaiting Therefore, the following snippet still throws the same exception as before: MediaItem mediaItem = MediaItem(
id: 'audio_1', album: 'Sample Album', title: 'Sample Title');
await AudioService.start(
backgroundTask: backgroundTask,
resumeOnClick: true,
notificationChannelName: 'Audio Service Demo',
notificationColor: 0xFF2196f3,
androidNotificationIcon: 'mipmap/ic_launcher',
);
// Uncomment delay to "fix".
// await Future.delayed(Duration(seconds: 5));
await AudioService.addQueueItem(mediaItem); However, when uncommenting the delay line, as a crude way of waiting for the background task to start, everything works as it should. Is there maybe some way to await the background task being started? |
I like that idea. I've implemented and committed it if you want to try it out. I haven't published a new release to the package server since I notice a pull request which I want to get to first. |
This fix and your pull request are now included in release 0.0.10. |
Seems to work fine, thank you! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with audio_service. |
Hello!
While experimenting with this plugin, I ran into the issue that whenever I call
AudioService.addQueueItem
, the following exception is thrown:This error was produced with the following code, based off the example in this repo:
https://gist.github.com/BeMacized/5ccc11f43c4b18bd1e40a1e539082721
Any idea what might cause this?
The text was updated successfully, but these errors were encountered: