Skip to content

fix(playback): resolve play/pause remote control failure for headphones#508

Open
mattsigal wants to merge 1 commit into
Moonfin-Client:mainfrom
mattsigal:bugfix/headphone-controls
Open

fix(playback): resolve play/pause remote control failure for headphones#508
mattsigal wants to merge 1 commit into
Moonfin-Client:mainfrom
mattsigal:bugfix/headphone-controls

Conversation

@mattsigal

Copy link
Copy Markdown
Contributor

Pull Request

Summary

This PR fixes an issue where Bluetooth headphones (such as Sony WH1000XM5 double-tap and AirPods stem squeeze gestures) fail to toggle play/pause when controlling playback on mobile devices. It also exposes standard stop, seek, repeat, and shuffle actions to system lock screens, smartwatches, and car integrations (like Android Auto/CarPlay). Basically, we had play, we had pause.... we didn't have playPause. 🤦

Related Issues

Link related issues or tickets separated by commas.

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

  • Added MediaAction.playPause to the active systemActions in audio_handler.dart so that the operating system correctly routes headset play/pause toggle events to the app's media session.
  • Seek & Stop Commands: Added MediaAction.stop, MediaAction.fastForward, and MediaAction.rewind to the session's active actions to enable lock screen seek bars, CarPlay skip-interval buttons, and stop-on-disconnection behavior.
  • Smartwatch & Car Integration: Exposes MediaAction.setRepeatMode and MediaAction.setShuffleMode capabilities to allow external controllers (like Wear OS/Apple Watch widgets and Android Auto) to toggle queue repeat/shuffle modes

Platform

  • Android
  • iOS
  • macOS
  • Windows
  • Linux
  • All / Shared code

Testing

Describe how this change was tested.

  • Tested on emulator / simulator
  • Tested on physical device
  • Manual testing completed - Tested with Android Pixel 10 and a pair of Sony Bluetooth headphones. Prior to this change, all controls worked except play/pause. With this PR, play/pause joins the club!
  • Not tested (explain why):

Test Steps

  1. Connect a Bluetooth headset to a mobile device.
  2. Launch Moonfin and start audio playback.
  3. Perform the headset's play/pause toggle gesture (double-tap or stem squeeze).
  4. Verify that the audio pauses and resumes cleanly.
  5. Verify that volume adjustment, track skipping, and seek commands map correctly.

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

…obust headset actions

- Add MediaAction.playPause to systemActions to permit Bluetooth headset toggle gestures (e.g. Sony WH1000XM5 double-tap, AirPods stem squeeze) to route to the active media session.
- Add MediaAction.stop, MediaAction.fastForward, and MediaAction.rewind to expose seek and stop capabilities to OS lockscreens and media controllers.
- Add MediaAction.setRepeatMode and MediaAction.setShuffleMode to support smartwatch and vehicle integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Current Video Does Not Show in IOS Media Controls

1 participant