Open ryanheise opened 3 years ago
Is this possible to implement for Cellular data as well? I did have an issue that came up with that. WiFi never seemed to be an issue but mobile data had a problem when the stream was paused and resumed from bluetooth.
I couldn't find anything similar to a wifi lock for cellular data, so I'm not sure exactly what is going on here. I'd need to probably see how this is handled in other Android apps.
Doing a Google search, I found the following which explains best practices with network connectivity:
But that seems to indicate that cellular network connectivity is managed automatically and using it after a sleep just introduces more latency, not an error.
Is your feature request related to a problem? Please describe.
On Android, if the audio being played in the background is being streamed over wifi, the wifi needs to be kept alive for that to work.
Describe the solution you'd like
Provide an option to acquire a wifi lock whenever the wifi is needed and release the lock when not needed.
Describe alternatives you've considered
This could alternatively be provided as a feature of other plugins to be used in conjunction with audio_service. E.g. just_audio or wakelock.
Additional context
(TODO: check past issues to see if this solution will help to resolve existing issues.)