We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
目前的registerAudioPlaybackCallback在低版本安卓上,thanos.getAudioManager().hasAudioFocus不工作,audioFocusChanged触发也不工作。 发现一个用registerAudioPolicy监测音频焦点变化的范例:https://github.com/dongpingwang/MyAudio/tree/main 这个方式可以兼容低版本安卓,并且方法onAudioFocusChange的参数值可以区分焦点变化是获取焦点还是丢失焦点,更加详细。 希望大神考虑一下😊
The text was updated successfully, but these errors were encountered:
@gameboyout 目前方案是Android 8+ 会通过registerAudioPlaybackCallback来监听。更低的android版本会hook MediaFocusControl来监听焦点切换。你测试的是Android7上不工作吗?
Sorry, something went wrong.
是的,Android7不工作。thanos.getAudioManager().hasAudioFocus('com.maxmpz.audioplayer')即使poweramp在播放音乐也始终返回false,audioFocusChanged触发不了。hook MediaFocusControl好像只是hook到mFocusStack新建了一个代理列表,谁监听焦点变化后push进去这部分我没有读懂源码😭
我是菜鸟,莫怪😉
晚点我测试下android7看看啥原因吧。
No branches or pull requests
目前的registerAudioPlaybackCallback在低版本安卓上,thanos.getAudioManager().hasAudioFocus不工作,audioFocusChanged触发也不工作。
发现一个用registerAudioPolicy监测音频焦点变化的范例:https://github.com/dongpingwang/MyAudio/tree/main
这个方式可以兼容低版本安卓,并且方法onAudioFocusChange的参数值可以区分焦点变化是获取焦点还是丢失焦点,更加详细。
希望大神考虑一下😊
The text was updated successfully, but these errors were encountered: