Skip to content

[Feature] Enable external player integration#113

Open
anilabhadatta wants to merge 6 commits into
NuvioMedia:Devfrom
anilabhadatta:Dev_External_Player
Open

[Feature] Enable external player integration#113
anilabhadatta wants to merge 6 commits into
NuvioMedia:Devfrom
anilabhadatta:Dev_External_Player

Conversation

@anilabhadatta

Copy link
Copy Markdown
Contributor

Summary

This PR implements and enables external player support for Nuvio Desktop. It introduces a completely detached, top-level DialogWindow for the external player picker that flawlessly tracks the main application boundaries to render correctly above the native video surface.

PR type

  • Reproducible bug fix
  • UI glitch/bug fix
  • Behavior bug/regression fix
  • Small maintenance only, with no UI or behavior change
  • Docs accuracy fix
  • Translation/localization only
  • Approved larger or directional change

Why

1. Enabling External Player Picker on Desktop:

  • Implementation: To enable the external player picker over the active video player (which is rendered via a heavyweight AWT SwingPanel that inherently obscures lightweight Compose UI), we extracted the selection picker into PlayerExternalPlayerPickerDialog. This spawns a genuine top-level OS DialogWindow injected with alwaysOnTop = true, transparent = true, and undecorated = true.

2. Emulating Inline UI Behaviors:

  • The dialog dynamically tracks the exact DPI-aware bounds of the Nuvio player window's content area. A ComponentAdapter ensures the dialog perfectly overlaps the app seamlessly even when moved or resized.
  • focusable = false prevents the OS title bar from losing focus, keeping window controls responsive.
  • A KeyboardFocusManager and WindowAdapter guarantee the dialog immediately hides if the Nuvio app is minimized or loses focus to a foreign application (e.g., Alt+Tab).

3. Direct Launch Intent Short-circuiting:

  • Updated ExternalPlayerPlaybackRequest with a preferredPlayerId parameter. App.kt intercepts requests containing this ID to bypass duplicate global UI prompts and immediately triggers the external OS launch intent.

Desktop scope

This PR modifies desktop native player UI logic and external intent dispatchers. Mobile codebase is unaffected.

  • Modified PlayerExternalPlayerPickerDialog.kt & .desktop.kt to implement the top-level boundary-tracking DialogWindow.
  • Modified PlayerScreenRuntimeUi.kt to trigger the new picker dialog instead of an inline Compose Box, while pausing the player.
  • Modified ExternalPlayerPlatform.kt and App.kt to propagate the explicit playerId and short-circuit the launcher intent.

Supported External Players

The platform detection logic (ExternalPlayerPlatform.desktop.kt) currently supports detecting and launching the following players automatically from default system paths:

  • Windows: VLC media player, MPC-HC, MPC-BE, PotPlayer, mpv, KMPlayer, GOM Player, Kodi, Zoom Player, BS.Player
  • macOS: VLC media player, Elmedia Player, IINA, mpv

Issue or approval

Feature Request: Enable external player integration.

UI / behavior impact

  • No UI change
  • No behavior change
  • UI changed only to fix a documented glitch/bug
  • Behavior changed only to fix a documented bug/regression
  • UI change has explicit maintainer approval
  • Behavior change has explicit maintainer approval

Policy check

  • I have read and understood CONTRIBUTING.md.
  • This PR is small, focused, and limited to one problem.
  • This PR is not cosmetic-only.
  • Any UI change fixes a linked glitch/bug and includes visual proof, or this PR has no UI change.
  • Any behavior change fixes a linked bug/regression or has explicit approval, or this PR has no behavior change.
  • This PR does not bundle unrelated refactors, cleanups, formatting, or drive-by changes.
  • This PR does not add dependencies, architecture changes, migrations, or product-direction changes without explicit approval.
  • I listed the testing performed below.

Scope boundaries

None.

Testing

Manually verified:

  1. Opened the external player picker while playback is active. Verified the dialog correctly appears on top of the native video surface instead of clipping behind it.
  2. Verified that resizing and moving the Nuvio window causes the picker dialog to perfectly track the content boundaries without lag.
  3. Verified the Nuvio window title bar buttons remain active and hoverable because the picker doesn't steal keyboard focus.
  4. Minimized the Nuvio window and used Alt+Tab to switch applications; verified the picker instantly hides and reappears correctly.
  5. Successfully selected an external player (e.g., VLC) and verified App.kt intercepts the preferredPlayerId and instantly launches the application without throwing a duplicate prompt.

Screenshots / Video

image image Screenshot 2026-06-22 223327 Screenshot 2026-06-22 223315

Breaking changes

None.

Linked issues

#112

@anilabhadatta

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-06-22 at 11 55 48 PM Screenshot 2026-06-22 at 11 55 16 PM

tested on mac

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.

1 participant