Adapt transcoding settings on pause/play when switching from WiFi to cellular and reverse

Be sure to search for existing feature requests before making a new one.

While the application is 100% user driven not every feature request will be accepted, they can be out of the application scope, too complex, or too specific.

Keep the template and fill it with as much details as possible

Feature description:

When switching from WiFi to Mobile Data the app should adapt accordingly and switch to transcoding. This is especially useful when you listen to FLAC on Wifi but have a limited data plan.
If you are in the middle of a longer song and realize that you were streaming FLAC direct all along this can add up to a lot of data consumption. Right now you have to play a new song for the transcoding changes to take effect, so you would have to play the current song from the beginning and seek manually to where you left off.

Problem solved:

I don’t expect this switch to be silent, and it would even be acceptable for it to take effect when pausing. That way you don’t get a lot of gaps when constantly switching back and forth.
I imagine reevaluating the current connection when the user hits play and adapting the transcoding mode according to that should be enough.
A nice addition would be switching the little cycling info snippet to the audio format to show the user that the switch worked.

Brought benefits:

For users that listen to high-res files at home/on Wifi but have a limited data plan and would like to reduce the bitrate in the go it would be practical for this switch to just be a simple pause/play again.

Other application solutions:

Most streaming services do this, I’m not sure how it is done technically.

Additional description and context:

Screenshots / Mockup:

If possible please provide screenshots of your idea of the implementation or how other application do this.

Streaming services serve the media in a way that allows different bitrate in the same media and the client can switch based on the current available bandwith or other parameters.
It requires the server to serve the media in special ways that most personal providers (Don’t know if any) do not support.

I’ve added an option to force restart when loosing wifi. It will restart the player with transcoding, so causing a small gap but ensure instant switching. The return to non transcoding when wifi is back will occur normally when changing media to avoid another glitch. No reason to only handle that when pausing or things like that since the switch can occurs without you knowing

Will this restart from the same point where it left off? In that case it solves the problem perfectly.

Well yes but not at the perfect millisecond as not possible and there will be an audible blank.