@vestra-player/sdk - v1.11.3
    Preparing search index...

    Interface RenderingState

    What Rendering.state and Rendering.setPreference report: the renderer drawing now and why, the saved choice, what the next start will use, and whether "gpu" can be chosen.

    The plugin adds "(Restart to Apply)" to its GPU item after the user changed the choice. restartPending compares the mode the next start will use with the mode this run started with, so it turns false again when the user changes the choice back.

    const state = await plugin.rendering.state();
    const title = state.restartPending
    ? "GPU Rendering (Experimental) (Restart to Apply)"
    : "GPU Rendering (Experimental)";
    console.log(title, state.nextMode, state.nextReason.message);

    0.5.13

    1.5.35

    interface RenderingState {
        mode: RenderingMode;
        reason: RenderingReason;
        preference: RenderingPreference;
        nextMode: RenderingMode;
        nextReason: RenderingReason;
        restartPending: boolean;
        gpu: { available: boolean; reason: RenderingReason | null };
    }
    Index

    The renderer drawing the video now; the same as SystemInfo.rendering.

    Why RenderingState.mode is what it is now.

    The saved choice; it applies from the next start.

    nextMode: RenderingMode

    The renderer the next start will use, as far as the player knows now: from the saved choice, the environment, the driver denylist and an earlier GPU crash.

    nextReason: RenderingReason

    Why the next start will use RenderingState.nextMode.

    restartPending: boolean

    true while RenderingState.nextMode differs from the mode this run started with, so a restart would change the renderer; false again when the user changes the choice back.

    gpu: { available: boolean; reason: RenderingReason | null }

    Whether the user can choose "gpu" now.

    Type Declaration

    • Readonlyavailable: boolean

      true when setPreference("gpu") would be accepted.

    • Readonlyreason: RenderingReason | null

      Why "gpu" cannot be chosen (no-gpu-backend, headless, denylist, previous-crash…); null while it is available.