Skip to content

feat(player): add IINA player integration for macOS#203

Open
mlharouna wants to merge 4 commits intoviu-media:masterfrom
mlharouna:feat/iina-player-integration
Open

feat(player): add IINA player integration for macOS#203
mlharouna wants to merge 4 commits intoviu-media:masterfrom
mlharouna:feat/iina-player-integration

Conversation

@mlharouna
Copy link
Copy Markdown

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

- 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.
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

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 IinaPlayer implementation and registered it in the player factory.
  • Extended configuration models/defaults/descriptions to support stream.player = iina and iina.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):
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

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).

Suggested change
def play_with_ipc(self, params: PlayerParams, socket_path: str):
def play_with_ipc(
self, params: PlayerParams, socket_path: str
) -> subprocess.Popen:

Copilot uses AI. Check for mistakes.
from .base import BasePlayer

PLAYERS = ["mpv", "vlc", "syncplay"]
PLAYERS = ["mpv", "vlc", "iina", "syncplay"]
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
PLAYERS = ["mpv", "vlc", "iina", "syncplay"]
PLAYERS = ["mpv", "vlc", "iina"]

Copilot uses AI. Check for mistakes.
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.

2 participants