Repository navigation
Conversation
新增默认关闭且持久化的鸿蒙混音开关,覆盖视频和直播。播放前等待原生 AudioSession 策略生效,串行管理激活、停用和清理,并保留系统强制中断及耳机断连处理。 加入 9 项 Dart 回归测试,覆盖初始化等待、策略切换、停用、错误、中断和持久化。
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
鸿蒙端在使用小艺输入法或其他应用进行语音输入时,音频焦点切换会打断正在播放的视频/直播。希望提供类似音乐应用的可选混音行为,同时保留默认策略和系统强制中断。
更改
AudioSession的CONCURRENCY_MIX_WITH_OTHERS,关闭时使用CONCURRENCY_PAUSE_OTHERS。设置在下一次播放/恢复播放或刷新播放源时应用,设置项已提示这一点。audio_session路径。无需修改或重编译 mpv。原
audio_session鸿蒙实现的setActive(false)未实际停用会话,激活会重复注册监听且未处理 Promise 拒绝,因此只替换鸿蒙端的激活与中断通道。验证
使用项目配套 Flutter OHOS 3.44.9 / Dart 3.12.2,按现有构建流程规范化包名后验证:
建议补充回归:分别检查视频/直播、小艺及其他语音输入、扬声器/有线/蓝牙耳机、开关关闭后的策略、双击暂停/恢复、通话强制中断和耳机断连。
范围与限制
.gitignore改动。参考:OpenHarmony 音频会话管理,所用策略接口从 API 12 提供。