tobexyz / yaacc-code

YAACC - UPNP Client and Server
Other
107 stars 14 forks source link

[FR] contol volume with volume buttons #93

Open ildar opened 10 months ago

ildar commented 10 months ago

Like here: https://www.reddit.com/media?url=https%3A%2F%2Fexternal-preview.redd.it%2F5lbgNSN6ShqzBT9m-F4wR5Dpia2Ab5tN9aX36fZ1EeQ.png%3Fauto%3Dwebp%26s%3Db19860dda13d91fbabcf213e55a64d7a100dc134 stages:

tobexyz commented 10 months ago

hi, just implemented your feature request. If the volume buttons are pressed on the main activity, the volume will be increased or decreased depending on the button for all active players. If the buttons are pressed on the activity for a certain player, the volume will be changed only for that player.

You can test it, building the branch feat/issue93 or installing the attached debug.apk

yaacc-debug.zip

ildar commented 10 months ago

wow, thanks a lot. I just tested and see it works when the app is active. But when the app isn't active (in background) the volume buttons don't work. I'm on Android 13 just in case.

tobexyz commented 10 months ago

Yes, your right the current solution is only working if the activity is active. I don't have a clue how to implement it for the background case. In that case other audio streams might be playing and so it's not clear for me how to decide that the push on a volume key is because the user wants to change the volume of Yaacc or another stream on the device.

Maybe we can go with this solution and do the background thing in the future. We can create another ticket for this, so we can't forget it :-)

ildar commented 10 months ago

The first part works fine. The issue may stay open for the 2nd part, see checkboxes I added above.

tobexyz commented 10 months ago

first part merged and will be integrated in the next upcoming release 4.1.0