diff --git a/src/components/media-types/html/index.jsx b/src/components/media-types/html/index.jsx
index a8cfd3468..d2e886718 100644
--- a/src/components/media-types/html/index.jsx
+++ b/src/components/media-types/html/index.jsx
@@ -55,7 +55,7 @@ export const HTMLComponent = (props) => {
const unpackZipFiles = async () => {
unpacking.current = true
- const buffer = dataRUIToBuffer(previewUri)
+ const buffer = await dataRUIToBuffer(previewUri)
try {
const filesArr = await prepareFilesFromZIP(buffer)
@@ -122,7 +122,7 @@ export const HTMLComponent = (props) => {
diff --git a/src/components/media-types/html/index.module.scss b/src/components/media-types/html/index.module.scss
index 38cea421a..cd425c14d 100644
--- a/src/components/media-types/html/index.module.scss
+++ b/src/components/media-types/html/index.module.scss
@@ -23,6 +23,8 @@
&.interactive {
pointer-events: all;
+ width: 100%;
+ height: 100%;
}
.preview {
diff --git a/src/components/media-types/vector/index.jsx b/src/components/media-types/vector/index.jsx
index dd2870cd6..229970d96 100644
--- a/src/components/media-types/vector/index.jsx
+++ b/src/components/media-types/vector/index.jsx
@@ -63,6 +63,6 @@ export const VectorComponent = ({
)
}
// svg version: src={`${src}?author=${_creator_}&viewer=${_viewer_}`}
-// iframe version: src={`https://iframe.teia.art/svg?src=${src}&creator=${_creator_}&viewer=${_viewer_}`}
+// iframe version: src={`https://iframe.teia.art/svg/?src=${src}&creator=${_creator_}&viewer=${_viewer_}`}
export default VectorComponent
diff --git a/src/utils/html.js b/src/utils/html.js
index 7a2f10d28..feb3e2a3e 100644
--- a/src/utils/html.js
+++ b/src/utils/html.js
@@ -288,14 +288,9 @@ export async function validateFiles(files) {
}
}
-export function dataRUIToBuffer(dataURI) {
- const parts = dataURI.split(',')
- const base64 = parts[1]
- const binaryStr = atob(base64)
- const len = binaryStr.length
- const bytes = new Uint8Array(len)
- for (let i = 0; i < len; i++) {
- bytes[i] = binaryStr.charCodeAt(i)
- }
+export async function dataRUIToBuffer(dataURI) {
+ const blob = await fetch(dataURI).then((r) => r.blob())
+ const binaryStr = await new Response(blob).arrayBuffer()
+ const bytes = new Uint8Array(binaryStr)
return bytes
}