Interface ICanvasMediaStaticProps

Static properties for the CanvasMedia class.

interface ICanvasMediaStaticProps {
    __staticProp?: null;
    append?: boolean;
    autoRenderVideo?: boolean;
    container?: null | HTMLElement;
    media:
        | HTMLCanvasElement
        | HTMLImageElement
        | HTMLVideoElement
        | Canvas<ICanvasCallbacksMap, ICanvasStaticProps, ICanvasMutableProps>
        | SVGImageElement;
    resizeDebounce?: number;
    resizeOnInit?: boolean;
    resizeOnRuntime?: boolean;
    viewportTarget?: keyof IViewportCallbacksMap;
}

Hierarchy (View Summary)

Properties

__staticProp?: null
append?: boolean

If true, appends the canvas to the container. Ignored if container is null.

true
autoRenderVideo?: boolean

If true, video elements will automatically render on each frame update.

true
container?: null | HTMLElement

Parent element used to determine canvas size. If null, it uses the viewport.

null
media:
    | HTMLCanvasElement
    | HTMLImageElement
    | HTMLVideoElement
    | Canvas<ICanvasCallbacksMap, ICanvasStaticProps, ICanvasMutableProps>
    | SVGImageElement

The media element to be rendered. Accepts a Canvas instance or common media elements like images and videos.

resizeDebounce?: number

Debounce time (ms) for resize handling.

0
resizeOnInit?: boolean

Automatically adjusts canvas size on initialization.

true
resizeOnRuntime?: boolean

Enables dynamic resizing based on viewport or container changes.

false
viewportTarget?: keyof IViewportCallbacksMap

Defines which dimension(s) should trigger a resize.

'any'