Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show current media volume on the webpage #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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