Android MediaPlayer. Catch onVolumeChange or something like

こ雲淡風輕ζ 提交于 2020-08-10 19:17:22

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!