audio_service icon indicating copy to clipboard operation
audio_service copied to clipboard

Adding an option in AudioServiceConfig to switch to lower priority state on AudioProcessingState.completed

Open skiluk opened this issue 2 years ago • 3 comments

Feature proposal

This would work similar to androidStopForegroundOnPause except stopForeground and stopSelf would be triggered when AudioProcessingState.completed.

Motivating use case(s)

We have an app that uses multiple audio files to play to the user in one stream of audio. Throughout this process we pause/unpause so the androidStopForegroundOnPause causes issues when playing in background as we do not have permissions to startForeground from the background. Using this feature would allow the notification to be dismissed when the audio is completed.

I have a PR almost completed for this feature if you would like me to submit

skiluk avatar Dec 15 '23 19:12 skiluk

PR added here

skiluk avatar Dec 15 '23 23:12 skiluk

@ryanheise wouldn't the proposed PR solve https://github.com/ryanheise/audio_service/issues/996 (and many other duplicates of it) at the same time?

You will not need to worry about pausing audio during interruption because of not having permissions to startForeground from the background in Android 12 +.

Mordtimer avatar Feb 16 '24 11:02 Mordtimer

Hi @Mordtimer , there are further discussion points raised in that PR (if you don't mind, you would be welcome to comment on those discussion points over on that PR).

ryanheise avatar Feb 17 '24 15:02 ryanheise