Skip to content

WebRenderer

import { Renderers } from "@swmansion/smelter"

Represents an instance of a website rendered using Chromium embedded in the smelter. It is utilized by a WebView component. Ensure that the smelter supports web rendering before utilizing the web renderer.

Renderers.RegisterWebRenderer

Type definitions

type RegisterWebRenderer = {
url: string;
resolution: {
width: number;
height: number;
};
embeddingMethod?:
| "chromium_embedding"
| "native_embedding_over_content"
| "native_embedding_under_content";
}

Properties

url

Url of a website that to render.

  • Type: string

resolution

Resulution of the rendered website.

  • Type: { width: number; height: number;}

embeddingMethod

Mechanism used to render input frames on the website.

  • Type: "chromium_embedding" | "native_embedding_over_content" | "native_embedding_under_content"
  • Default value: ???
  • Supported values:
    • native_embedding_over_content - Renders a website without any inputs, then overlays the inputs onto the website.
    • native_embedding_under_content - Renders a website without any inputs, then underlays the inputs beneath the website.
    • chromium_embedding - Pass raw input frames as JS buffers so they can be rendered, for example, using a <canvas> component.