mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-15 05:36:17 -08:00
fix(workspace): defer embedded mpv palette support check
This commit is contained in:
1 parent
f7ad17298f
commit
d7e7a8abda
6 files changed
+108
-22
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.
|
||||
|
||||
|
||||
@@ -189,11 +189,14 @@ Command palette behavior is shell-owned but view-extensible:
|
||||
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 an async
|
||||
`window.electron.getEmbeddedMpvSupport()` check resolves to `supported`
|
||||
(mirroring the Settings dropdown gate). 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.
|
||||
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