Skip to content

🎥 Make videos programmatically with React

Update Artifact.tsx

Jonny Burger12c63f71e930
diff --git a/packages/core/src/Artifact.tsx b/packages/core/src/Artifact.tsx
index 74c6dfc6c3..673e19fb78 100644
--- a/packages/core/src/Artifact.tsx
+++ b/packages/core/src/Artifact.tsx
@@ -24,23 +24,23 @@ export const Artifact: React.FC<{
return;
}
- if (typeof content === 'string') {
+ if (content instanceof Uint8Array) {
registerRenderAsset({
type: 'artifact',
id,
- content,
+ content: btoa(new TextDecoder('utf8').decode(content)),
filename,
frame,
- binary: false,
+ binary: true,
});
} else {
registerRenderAsset({
type: 'artifact',
id,
- content: btoa(new TextDecoder('utf8').decode(content)),
+ content,
filename,
frame,
- binary: true,
+ binary: false,
});
}