Skip to content

Conversation

mdczaplicki
Copy link

These changes are about to add a current media volume (after pressing the button volume up/down).

I haven't tested it, I don't have the infrastructure, so I was thinking that you could help me here and tell if it works or not.

I'm not that familiar with Java, but my initial idea was to include the current media volume value already when generating the HTML, but it seems that you are not using any framework for this and I didn't want to write a gibberish code that would convert streams to strings, replace something and then back again to streams.

@tanaka42
Copy link
Owner

tanaka42 commented Feb 10, 2021

Hello,

Thank you for your contribution.

I will not merge it into my repository as is because your call to function getStreamVolume points to a particular audio stream ("AudioManager.STREAM_MUSIC").
On the contrary, my call to function adjustVolume points to no particular stream : as stated in the documentation this "Adjusts the volume of the most relevant stream." https://developer.android.com/reference/android/media/AudioManager#adjustVolume(int,%20int)
Thanks to this behaviour, at the moment the app can adjust volume of a phonecall if one is occuring, of music if music is playing and so on, and I want it that way. With your current code, if a phonecalls occurs, the app will raise/lower volume of the phonecall but will still display the volume level of the music.

Anyway, I think your code should work (as long as music is playing), I will try to test it asap and tell you if it works.

Best regards
Tanaka42

@mdczaplicki
Copy link
Author

mdczaplicki commented Feb 10, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants