feat: add IINA auto-pause support via mpv IPC socket - #858
Open
yuamera wants to merge 1 commit into
Open
Conversation
yuamera
force-pushed
the
auto-pause-support-iina
branch
from
May 22, 2026 06:18
0935df5 to
ced811d
Compare
Add auto-pause support for IINA, a modern macOS media player based on mpv. Implementation: - Add BGIINA music player class implementing BGMMusicPlayer protocol - Control IINA playback via mpv JSON IPC protocol over Unix domain socket - Support multiple socket paths: /tmp/iina-mpv-socket, /tmp/mpv-socket - Cache successful socket path for performance Security measures: - Use lstat to prevent symlink attacks - Verify socket file owner matches current user - Verify peer credentials via LOCAL_PEERCRED after connection - Set socket timeout (5 seconds) to prevent blocking Commands used: - get_property "pause" - Query playback state - set_property "pause", true/false - Control playback Prerequisite: User must configure ~/.config/mpv/mpv.conf with: input-ipc-server=/tmp/iina-mpv-socket Files changed: - BGMApp/BGMApp/Music Players/BGIINA.h (new) - BGMApp/BGMApp/Music Players/BGIINA.m (new) - BGMApp/BGMApp/Music Players/BGMMusicPlayers.mm (modified) - BGMApp/BGMApp.xcodeproj/project.pbxproj (modified) Tested on: macOS 15.7.5 (Intel x86_64), IINA 1.4.3
yuamera
force-pushed
the
auto-pause-support-iina
branch
from
May 22, 2026 06:21
ced811d to
cb5f661
Compare
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.
Add IINA Auto-Pause Support
Summary
Add auto-pause support for IINA, a modern macOS media player based on mpv.
Background
IINA is one of the most popular open-source media players on macOS. Unlike Spotify/iTunes/VLC, IINA does not support AppleScript or Scripting Bridge, which are the standard mechanisms used by Background Music to control music players.
After extensive research, we discovered that IINA is built on top of mpv and supports mpv's JSON IPC protocol via Unix domain socket.
Implementation
BGIINAmusic player class implementingBGMMusicPlayerprotocol/tmp/iina-mpv-socket,/tmp/mpv-socketSecurity Measures
lstatto prevent symlink attacksLOCAL_PEERCREDafter connectionCommands Used
get_property "pause"- Query playback stateset_property "pause", true/false- Control playbackPrerequisite
User must configure
~/.config/mpv/mpv.confwith:Then restart IINA for the configuration to take effect.
Files Changed
BGMApp/BGMApp/Music Players/BGIINA.h(new)BGMApp/BGMApp/Music Players/BGIINA.m(new)BGMApp/BGMApp/Music Players/BGMMusicPlayers.mm(modified - add IINA import and registration)BGMApp/BGMApp.xcodeproj/project.pbxproj(modified - add new files)Testing