feat(player): add IINA player integration for macOS#203
feat(player): add IINA player integration for macOS#203mlharouna wants to merge 4 commits intoviu-media:masterfrom
Conversation
- Update `IinaPlayer` to pass options natively via MPV flags. - Add `iina` to supported players in `StreamConfig` and `PlayerFactory`. - Include `IinaConfig` in the main `AppConfig` and provide a config description.
There was a problem hiding this comment.
Pull request overview
Adds a new macOS-focused player backend by integrating the IINA app into Viu’s player layer, exposing it via configuration and updating IPC behavior to gracefully fall back when non-mpv players are selected.
Changes:
- Added an
IinaPlayerimplementation and registered it in the player factory. - Extended configuration models/defaults/descriptions to support
stream.player = iinaandiina.args. - Updated IPC playback service logic to fall back to standard playback when IPC is enabled for non-mpv players; updated README accordingly.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| viu_media/libs/player/player.py | Registers iina in the factory and allowlist. |
| viu_media/libs/player/iina/player.py | New IINA player implementation using iina-cli with mpv-style options passthrough. |
| viu_media/libs/player/iina/init.py | Adds the new package module for IINA player. |
| viu_media/core/config/model.py | Adds IinaConfig and wires it into AppConfig; allows stream.player = iina. |
| viu_media/core/config/descriptions.py | Adds descriptions for IINA_ARGS and APP_IINA. |
| viu_media/core/config/defaults.py | Adds default IINA_ARGS. |
| viu_media/core/config/init.py | Exports IinaConfig from the config package. |
| viu_media/cli/service/player/service.py | Implements IPC fallback behavior for non-mpv players. |
| README.md | Documents IINA as a macOS player option and updates config example text. |
| subprocess.run(args, check=False, env=detect.get_clean_env()) | ||
| return PlayerResult(episode=params.episode) | ||
|
|
||
| def play_with_ipc(self, params: PlayerParams, socket_path: str): |
There was a problem hiding this comment.
play_with_ipc override doesn’t match the BasePlayer interface: it’s missing the -> subprocess.Popen return annotation and currently has an untyped signature. This can trigger pyright’s incompatible override checks and is inconsistent with VlcPlayer/MpvPlayer. Update the method signature to match the base class (and keep raising NotImplementedError if IPC isn’t supported).
| def play_with_ipc(self, params: PlayerParams, socket_path: str): | |
| def play_with_ipc( | |
| self, params: PlayerParams, socket_path: str | |
| ) -> subprocess.Popen: |
| from .base import BasePlayer | ||
|
|
||
| PLAYERS = ["mpv", "vlc", "syncplay"] | ||
| PLAYERS = ["mpv", "vlc", "iina", "syncplay"] |
There was a problem hiding this comment.
PLAYERS includes "syncplay", but the factory has no branch to construct a Syncplay player, and StreamConfig.player doesn’t allow "syncplay". Keeping it in this allowlist makes the validation/error messaging misleading. Either remove "syncplay" from PLAYERS or implement/allow it consistently across config + factory.
| PLAYERS = ["mpv", "vlc", "iina", "syncplay"] | |
| PLAYERS = ["mpv", "vlc", "iina"] |
This PR adds support for the IINA (https://github.com/iina/iina) media player on macOS
Users on macOS can now choose iina as their player in the config, and Viu will launch playback through IINA and makes sure that if IPC is enabled for mpv playback still works by falling back to normal mode. Also the README has been updated