spinninghamster commented on issue #295:
URL:
https://github.com/apache/cordova-plugin-media/issues/295#issuecomment-718122429
@breautek Thank you for your detailed explanation. We do actually use it on
Android only at the moment. It does appear to be a "grey area" with that
problem.
We're certainly not trying to "dictate" the volume of the app to the user,
however we are also facing the issue where the device volume is 100% but the
"MEDIA" channel is lowered or muted by the user because they think they are
temporarily lowering the sound or muting it. Later when they increase the
device sound again, it's at 100% for all other apps but for this app it's muted
and they then contact us and ask us why they're not receiving sound
notifications anymore. We tell them to put the sound to 100% and they do that.
We even went "on-location" to the devices and found that the device is at
100% volume but only when the notification sound of the app is playing, the
"MEDIA" stream is muted because they lowered the sound right when that
notification sound was playing and were not able to put it back up or thought
it was already back up.
It's difficult to explain to some users that there is a device sound volume
and a "MEDIA" volume for the app. But I understand how it works and why it
works that way, it's just frustrating and causing problems for us and we don't
see any easy way to fix it.
We did find this piece of code in CordovaActivity.java:
```
// Wire the hardware volume controls to control media if desired.
String volumePref = preferences.getString("DefaultVolumeStream", "");
if ("media".equals(volumePref.toLowerCase(Locale.ENGLISH))) {
setVolumeControlStream(AudioManager.STREAM_MUSIC);
}
```
And tried commenting it out to disable changing the MEDIA volume with
buttons. We also tried to change the channels in all locations of the code from
STREAM_MEDIA to STREAM_MUSIC or even STREAM_NOTIFICATION (in fact, we tried all
of them) and never got it working.
Again, I understand why it works that way but maybe in the future you could
give some thought on how to fix it in case the user thinks the sound is at 100%
when adjusting the volume when a notification is not playing, only to find out
they don't receive sound notifications because the media channel is muted.
In the meantime, I will keep looking for a solution and update here if I
find it :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]