Skip to content

🐞 fix: 为 macOS 添加 toggle 命令处理以尝试解决在 macOS 26 上的播放暂停按钮无效的 bug#869

Merged
imsyy merged 1 commit into
SPlayer-Dev:devfrom
apoint123:fix/add-toggle-command-for-macos
Feb 12, 2026
Merged

🐞 fix: 为 macOS 添加 toggle 命令处理以尝试解决在 macOS 26 上的播放暂停按钮无效的 bug#869
imsyy merged 1 commit into
SPlayer-Dev:devfrom
apoint123:fix/add-toggle-command-for-macos

Conversation

@apoint123
Copy link
Copy Markdown
Member

为 macOS 添加 toggle 命令处理以尝试解决在 macOS 26 上的播放暂停按钮无效的 bug

#867

Copilot AI review requested due to automatic review settings February 11, 2026 08:33
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @apoint123, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

此拉取请求旨在增强 macOS 上的系统媒体控制功能,通过实现一个专门的切换处理程序来解决播放/暂停按钮无法正常工作的问题。这一改进确保了用户可以通过系统级媒体控件可靠地控制媒体播放,从而提升了用户体验。

Highlights

  • macOS 播放/暂停按钮修复: 为 macOS 系统媒体集成添加了 togglePlayPauseCommand 的处理逻辑,以解决在 macOS 26 上播放/暂停按钮无效的问题。
  • 新增 add_toggle_handler 函数: 引入了一个新的私有函数 add_toggle_handler,用于注册并处理播放/暂停切换命令,根据当前播放状态发送相应的播放或暂停事件。
  • 集成切换命令处理: 在 MacosImpl 的初始化过程中调用了 add_toggle_handler,确保系统媒体控制器能够响应播放/暂停切换操作。
Changelog
  • native/external-media-integration/src/sys_media/macos.rs
    • 新增了 add_toggle_handler 函数,用于处理 macOS 媒体控制器的播放/暂停切换命令。
    • init 方法中调用了 add_toggle_handler,以启用播放/暂停按钮的功能。
Activity
  • 没有检测到人类活动。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

为 macOS 增加对 togglePlayPauseCommand 的事件处理,用于尝试解决 macOS 26 上系统播放/暂停媒体键(F8)不触发的问题(关联 #867)。

Changes:

  • 新增 add_toggle_handler:监听 MPRemoteCommandCenter.togglePlayPauseCommand,并基于 MPNowPlayingInfoCenter.playbackState 映射为 Play/Pause 事件
  • setup_event_listeners 中注册 toggle 播放/暂停处理器

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread native/external-media-integration/src/sys_media/macos.rs
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

此 PR 为 macOS 添加了 togglePlayPauseCommand 命令处理,以解决在新版 macOS 上播放/暂停按钮可能无效的问题。新增的 add_toggle_handler 函数逻辑清晰,通过检查当前播放状态来决定发送 PlayPause 事件,并正确地集成到了 setup_event_listeners 中。代码整体质量不错,我只提出一个关于错误处理的改进建议,以增强代码的健壮性。

Comment thread native/external-media-integration/src/sys_media/macos.rs
@imsyy imsyy merged commit c0e0256 into SPlayer-Dev:dev Feb 12, 2026
6 checks passed
@apoint123 apoint123 deleted the fix/add-toggle-command-for-macos branch February 12, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants