The plugin adds advice only when the graphics driver is the cause.
reason.code is looked up among the codes the plugin knows; an unknown
code from a newer player falls through to the player's own message.
const { reason } = await plugin.rendering.state();
// Advice for the codes this plugin knows; any other code shows the message.
const advice: Partial<Record<RenderingReasonCode, string>> = {
denylist: "Update the graphics driver to use the GPU.",
"previous-crash": "The GPU renderer crashed earlier; it is retried after an update.",
};
console.log(advice[reason.code] ?? reason.message);
Why the player renders the way it does, as a stable kebab-case code. A newer player may add codes: compare with the ones you handle and show RenderingReason.message for the rest. The codes:
defaultpendingheadlessno-gpu-backenddefault).envVESTRA_RENDER,VESTRA_SOFTWARE_RENDER).preferencedefault.denylistprevious-crashinit-failedwindow-fallback