about summary refs log tree commit diff
path: root/MatrixUtils.Web/wwwroot/index.html
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-07-02 02:00:43 +0200
committerRory& <root@rory.gay>2024-07-02 02:00:43 +0200
commitcb038a49c417813bbb09f770e49aa28169a83710 (patch)
treef16944061c8ba7a8714607fd269875d71ea18e41 /MatrixUtils.Web/wwwroot/index.html
parentSome cleanup, update libs (diff)
downloadMatrixUtils-cb038a49c417813bbb09f770e49aa28169a83710.tar.xz
Authenticated media foundations HEAD github/main main
Diffstat (limited to 'MatrixUtils.Web/wwwroot/index.html')
-rw-r--r--MatrixUtils.Web/wwwroot/index.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/MatrixUtils.Web/wwwroot/index.html b/MatrixUtils.Web/wwwroot/index.html
index 5182193..7425de2 100644
--- a/MatrixUtils.Web/wwwroot/index.html
+++ b/MatrixUtils.Web/wwwroot/index.html
@@ -57,6 +57,22 @@
                     height: window.innerHeight
                 };
             }
+
+            setImageStream = async (element, imageStream) => {
+                if(!(element instanceof HTMLElement)) {
+                    console.error("Element is not an HTMLElement", element);
+                    return;
+                }
+                
+                const arrayBuffer = await imageStream.arrayBuffer();
+                const blob = new Blob([arrayBuffer]);
+                const url = URL.createObjectURL(blob);
+                const image = document.getElementById(imageElementId);
+                image.onload = () => {
+                    URL.revokeObjectURL(url);
+                }
+                image.src = url;
+            }
         </script>
         <script src="_framework/blazor.webassembly.js"></script>
 <!--        <script>navigator.serviceWorker.register('service-worker.js');</script>-->