mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-16 22:26:16 -08:00
Merge pull request #1093 from larsemig/feat/embedded-mpv-command-palette
feat(workspace): add embedded MPV to the command palette
This commit is contained in:
6 files changed
+243
-28
No files matched your search
@@ -79,7 +79,7 @@ The renderer never gets direct native-module access. It can only call the preloa
|
||||
- dispose session
|
||||
- subscribe to session updates
|
||||
|
||||
Settings uses the preload support API only as a lightweight availability check. That check verifies platform, experiment gating, addon presence, and bundled platform runtime presence without `require()`-loading `embedded_mpv.node`. This avoids blocking Settings navigation on synchronous native-addon loading and code-signing or dynamic-linker work.
|
||||
Settings uses the preload support API as an availability and capability check. Unsupported paths return before loading the addon when platform, experiment gating, addon presence, bundled runtime presence, or the Linux `mpv` executable check fails. Supported paths load `embedded_mpv.node` so the renderer can receive capability flags from the actual addon binary. Avoid calling this support API from global workspace startup paths; use an explicit user action or idle preparation path when a renderer surface only needs to reveal optional Embedded MPV UI.
|
||||
|
||||
When `embedded-mpv` is the saved player, the settings store schedules an idle `prepareEmbeddedMpv()` call. This intentionally moves the first native addon load away from the click-to-play path. It can still block the Electron main process briefly because Node native addon loading is synchronous, but doing it during idle is less visible than doing it when the user clicks a video. Actual MPV session creation still happens on playback because it needs the current Electron window handle and viewport bounds.
|
||||
|
||||
|
||||
@@ -184,11 +184,19 @@ Command palette behavior is shell-owned but view-extensible:
|
||||
visibility — a navigation command like `Open sources` is invisible while
|
||||
the user is on `/workspace/sources` but the id stays in storage so it
|
||||
reappears in the recent section after navigating away.
|
||||
7. Five "Switch player to X" commands are registered globally by
|
||||
`WorkspacePlayerCommandsContributor`. The MPV/VLC entries are visible only
|
||||
in Electron, and the entry matching the current `SettingsStore.player()`
|
||||
value is disabled. The new player setting applies to the next playback
|
||||
session; an existing stream is not re-mounted.
|
||||
7. Six "Switch player to X" commands are registered globally by
|
||||
`WorkspacePlayerCommandsContributor` (VideoJS, HTML5, ArtPlayer, Embedded
|
||||
MPV, MPV, VLC). Each command carries a `requires` flag gating its
|
||||
visibility: the MPV/VLC ("managed-external") entries are visible only when
|
||||
`RuntimeCapabilitiesService.supportsManagedExternalPlayers` is true, and the
|
||||
Embedded MPV ("embedded-mpv") entry is visible only after the command
|
||||
palette lazily preloads an async `window.electron.getEmbeddedMpvSupport()`
|
||||
check and it resolves to `supported` (mirroring the Settings dropdown gate).
|
||||
Do not run this Embedded MPV support check from workspace shell bootstrap:
|
||||
supported desktop builds may load the native addon while resolving
|
||||
capabilities. The entry matching the current `SettingsStore.player()` value
|
||||
is disabled. The new player setting applies to the next playback session; an
|
||||
existing stream is not re-mounted.
|
||||
|
||||
Keyboard shortcut help is shell-owned:
|
||||
|
||||
|
||||
Reference in new issue
Block a user