Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for IINA player #360

Merged
merged 11 commits into from
Nov 29, 2020
Merged

Add support for IINA player #360

merged 11 commits into from
Nov 29, 2020

Conversation

albertosottile
Copy link
Member

@albertosottile albertosottile commented Oct 17, 2020

This PR adds support for IINA on macOS.

Implementation is heavily based on the existing MPV classes. Please squash the commit messages when merging.

A few implementation notes:

  • options for mpv are not set via arguments but rather with properties sent via IPC
  • the player path refers to the IINA binary but Syncplay needs to run iina-cli to start the player. This path substitution is transparently executed in IinaPlayer.getExpandedPath. EDIT: nothing transparent about that. Even if I pointed the IINA_PATH to the IINA binary, the GUI shows only the expanded path so, it points to iina-cli.
  • IINA does not start with an instance of the video player but with an "Open File" window. This prevents Syncplay from loading a media file from its GUI. To overcome this issue, a custom image is passed to iina-cli which forces the creation of a mpv instance, controllable by Syncplay. Related to: mpv option force-window immediate mode revoke fatal error in IINA iina/iina#437
  • supporting IINA required some minor modifications to python_mpv_jsonipc.py which is effectively vendor code. I tried to keep these changes minimal in the event that we need or want to upgrade the embedded copy of this package.
  • writing messages via in-player chat does not work as the Enter key is mapped to a different function (go full screen) IINA is eating keystrokes and not passing them to mpv. Chat messages are correctly shown in the OSD but must be typed in the Syncplay window.
  • passing the right environment to the mpv/iina-cli processes is restored (as described in c07206c)

Closes: #359
Related to: #144, iina/iina#1833, iina/iina#396

Apparently, `iina-cli` gets confused when launched from a frozen app
and automatically adds `--stdin` to its passed launch arguments.
But then, it waits for a file to be piped and, because there is none,
the player crashes almost immediately. Sending `--no-stdin` to the
process resolves the ambiguity and does not cause any harm if
Syncplay is started from sources.
@Et0h Et0h mentioned this pull request Oct 24, 2020
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.

IINA Support
2 participants