问题
I have a situation. Some custom Android
firmware does not send onAudioFocusChange
in some circumstances, but instead just lower my application audio output.
Volume changes only for my app, not the main volume control. I really don't know how it does it, maybe on the core level.
I want to pause, my player, when someone acquires audio stream, not just lower sound. So as a workaround I want catch this volume change event and process it by myself.
Problem is that I don't know what to catch and even where. In MediaPlayer, MediaSessionCompat, or elsewhere?
Any ideas appreciated.
来源:https://stackoverflow.com/questions/62592143/android-mediaplayer-catch-onvolumechange-or-something-like