🎥 Make videos programmatically with React
`remotion`: Export HtmlInCanvas.isHtmlInCanvasSupported and isHtmlInCanvasSupported
Jonny Burger2eeb91aaf30f
diff --git a/packages/core/src/HtmlInCanvas.tsx b/packages/core/src/HtmlInCanvas.tsxindex cd4d4d4b12..82783cabee 100644--- a/packages/core/src/HtmlInCanvas.tsx+++ b/packages/core/src/HtmlInCanvas.tsx@@ -31,7 +31,7 @@ type HTMLCanvasWithLayoutSubtree = HTMLCanvasElement & {requestPaint: () => void;};-const isHtmlInCanvasSupported = () => {+export const isHtmlInCanvasSupported = (): boolean => {if (typeof document === 'undefined') {return false;}@@ -279,7 +279,13 @@ const HtmlInCanvasInner: React.FC<);};-export const HtmlInCanvas = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);+const HtmlInCanvasWrapped = wrapInSchema(HtmlInCanvasInner, htmlInCanvasSchema);++export const HtmlInCanvas = Object.assign(HtmlInCanvasWrapped, {+ isHtmlInCanvasSupported,+}) as typeof HtmlInCanvasWrapped & {+ readonly isHtmlInCanvasSupported: typeof isHtmlInCanvasSupported;+};HtmlInCanvas.displayName = 'HtmlInCanvas';diff --git a/packages/core/src/index.ts b/packages/core/src/index.tsindex a96485c92a..69fe78e737 100644--- a/packages/core/src/index.ts+++ b/packages/core/src/index.ts@@ -141,7 +141,7 @@ export {Solid,SolidProps,} from './canvas-effects/index.js';-export {HtmlInCanvas} from './HtmlInCanvas.js';+export {HtmlInCanvas, isHtmlInCanvasSupported} from './HtmlInCanvas.js';export type {HtmlInCanvasProps} from './HtmlInCanvas.js';export type {AnyZodObject} from './any-zod-type.js';export {Artifact} from './Artifact.js';