Repository navigation
fix(android): 增强原生播放器与系统媒体控件的交互体验 - #14
Merged
Merged
Conversation
- 使用 ForwardingPlayer 接管 MediaSession 上下首命令,避免单项队列下系统媒体面板按钮置灰或点击无响应 - 为 native 下一首快路径增加同步锁与 5s 超时释放,避免 JS 异常路径导致快路径永久卡住 - 新增 Android native cleanup 接口,清空播放列表时同步清理 MediaItem、通知栏和 queuedNext 缓存 - 同步 MediaMetadata 的时长与封面数据,改善锁屏、系统媒体面板、蓝牙和 Android Auto 显示 - 将封面 JPEG 编码缓存化并放到后台线程执行,减少主线程卡顿 - 支持 authoritative progress 事件,修复系统媒体面板 seek 后 JS 进度估算不同步
|
Vip can't be played |
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.
📌 变更类型
📝 变更说明
本 PR 修复 Android 系统媒体控制栏、锁屏、蓝牙和 Android Auto 场景下的播放控制与元信息同步问题。
主要变更:
ForwardingPlayer接管 MediaSession 上下首命令,避免 ExoPlayer 单项队列下系统媒体面板按钮置灰或点击无响应。MediaItem、通知栏、queuedNext缓存和快路径状态。MediaMetadata的真实时长与封面数据,改善锁屏、系统媒体面板、蓝牙和 Android Auto 的歌曲信息显示。authoritative progress事件,修复系统媒体面板 seek 后 JS 端进度估算基准未刷新、导致界面进度不同步的问题。这些改动主要解决 Android 原生媒体入口与 JS 播放状态之间不同步的问题,提升后台、锁屏、通知栏和外部媒体控制设备上的播放体验。
🔗 关联 Issue
Closes #
📱 影响范围
✅ 自检清单
masterpnpm lint且无 warningpnpm typecheck且无报错说明:
typecheck尚未在本次提交后确认执行,如提交前已执行可再勾选。master后再勾选第一项。📸 截图 / 录屏 (UI 类 PR 必填)
本 PR 不涉及 UI 布局改动。
| 改动前 | 改动后 |

🧪 测试方式
MediaItem的情况下,确认系统媒体面板上一首 / 下一首按钮不会异常置灰或点击无响应。💬 其他说明 (选填)
本次改动主要集中在 Android 原生播放桥接与 MediaSession 行为,风险点包括:
MediaMetadata.artworkData的展示策略可能存在差异。后续如果仍发现特定设备上媒体按钮状态异常,可结合对应设备的 MediaSession 日志继续补充兼容处理。