Skip to content
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.addQueueItem Documentation #147

Closed
mohammadne opened this issue Jan 4, 2020 · 3 comments
Closed

AudioService.addQueueItem Documentation #147

mohammadne opened this issue Jan 4, 2020 · 3 comments
Assignees

Comments

@mohammadne
Copy link

mohammadne commented Jan 4, 2020

what am I doing is below to your example:
1 - press audioPlayerButton as usuall
2 - then add floatingAction and onPressed callBack is below :

onPressed: () {
              AudioService.addQueueItem(
                MediaItem(
                  id: "https://s3.amazonaws.com/scifri-episodes/scifri20181123-episode.mp3",
                  album: "Science Friday",
                  title: "A Salute To Head-Scratching Science",
                  artist: "Science Friday and WNYC Studios",
                  duration: 5739820,
                  artUri:
                      "https://media.wnyc.org/i/1400/1400/l/80/1/ScienceFriday_WNYCStudios_1400.jpg",
                ),
              );
            },

3 - then in AudioPlayerTask class add onAddQueueItem override
4 - in onAddQueueItem:

  @override
  void onAddQueueItem(MediaItem mediaItem) {
    super.onAddQueueItem(mediaItem);
    _queue.add(mediaItem);
    AudioServiceBackground.setQueue(_queue);
  }

and I get error below :

E/flutter (13011): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, This session doesn't support queue management operations, null)

also I think working with queue is a little cumbersome , because based on UI we need to override queue , add , delete in different routes of app not at the startUp the app.

@ryanheise ryanheise self-assigned this Jan 4, 2020
@ryanheise
Copy link
Owner

Can you try passing in enableQueue: true to start?

@mohammadne
Copy link
Author

Thanks , works well !!!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants