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

Some Features request #150

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

Some Features request #150

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

Comments

@mohammadne
Copy link

mohammadne commented Jan 5, 2020

1-
in my case the user , based on the UI can selected a album so I don't know which album he/she will be choose so what I did is to set _queue in AudioPlayerTask:
final _queue = <MediaItem>[];
and I add mediaItems to it with a for loop in UI in AudioService.addQueueItem()
but the problem is that user need to press next button to have a the behavior when we set in final _queue = <MediaItem>[];
2-
also there is multiple playing state , means playing state can be playInOrder , shuffle , repeatQueue , repeatCurrentlyAudio and ... .
so in

void _handlePlaybackCompleted() {
    if (hasNext) {
      onSkipToNext();
    } else {
      onStop();
    }
  }

we have multiple states , how we can handle it after calling AudioService.start() to handle state ?
3-
in modern music players there is an smooth play and pause , means when we pause the audio the sound will not suddenly drop to zero , for example it takes one second to pause in smooth way.
adding this feature is awesome .
4-
can you please explain how to use onFastForward
5-what is onRewind in AudioPlayerTask and shouldPreloadArtwork in AudioService.start()

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

1-
in my case the user , based on the UI can selected a album so I don't know which album he/she will be choose so what I did is to set _queue in AudioPlayerTask:
final _queue = <MediaItem>[];
and I add mediaItems to it with a for loop in UI in AudioService.addQueueItem()
but the problem is that user need to press next button to have a the behavior when we set in final _queue = <MediaItem>[];

Can you suggest what API you would like added?

2-
also there is multiple playing state , means playing state can be playInOrder , shuffle , repeatQueue , repeatCurrentlyAudio and ... .
so in

void _handlePlaybackCompleted() {
    if (hasNext) {
      onSkipToNext();
    } else {
      onStop();
    }
  }

we have multiple states , how we can handle it after calling AudioService.start() to handle state ?

audio_service doesn't try to handle anything more than what is necessary to interface with standard remote control clients and background APIs. That does not mean that you can't have additional state which you implement in your own way, but it does mean that audio_service is not responsible for it.

There is a customAction call which should allow a client to send custom actions like "shuffle" to the background audio task. In the future, there may also be custom events that the background task can broadcast to clients. Until then, you can use standard Dart APIs to communicate bidirectionally between the isolates using IsolateNameServer. That class is documented in the standard Dart API documentation.

3-
in modern music players there is an smooth play and pause , means when we pause the audio the sound will not suddenly drop to zero , for example it takes one second to pause in smooth way.
adding this feature is awesome .

This plugin isn't actually involved in playing sound. Whatever other plugins you're using to play sound, you should request that feature request with those plugins.

4-
can you please explain how to use onFastForward

See #146 but replace the word "pause" with "fastForward", and that can provide an explanation. Also, study the example and look at how "pause" works and that is the same as how "fastForward" works. The plugin doesn't care how you implement the callbacks, it is up to you what you want them to do.

5-what is onRewind in AudioPlayerTask and shouldPreloadArtwork in AudioService.start()

onRewind is like onFastForward. You can implement the callback to do whatever you want it to do. However, I would strongly suggest that you implement them to rewind and fast forward the audio. Just like you can implement "pause" to do whatever you want, but I would strongly suggest that you implement it to pause the audio.

shouldPreloadArtwork is undocumented since most people do not need it and the implementation of it is not reliable, so I don't necessarily recommend that you use it. But you can search the past issues and find the discussion of it.

@ryanheise
Copy link
Owner

Can you clarify your first point?

@ryanheise
Copy link
Owner

Closing due to inactivity.

@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.
Projects
None yet
Development

No branches or pull requests

2 participants