Embedding a Matterport
-
I have been trying to embed a Matterport with an HTML i-frame. Doing a cross-compatibility browser check, I then discovered that Edge and Firefox (at least, I stopped there) completely shut down those types of embeds due to security reasons. I tried adding javascript:
<div id="matterport-container"></div> <script> document.addEventListener("DOMContentLoaded", function() { // Create a new iframe element var iframe = document.createElement("iframe"); // Set the iframe attributes iframe.src = "https://my.matterport.com/show/FAKEID"; iframe.width = "853"; iframe.height = "480"; iframe.frameborder = "0"; iframe.allowfullscreen = true; // Append the iframe to the container element var container = document.getElementById("matterport-container"); container.appendChild(iframe); }); </script>
No avail. I am new to this software, and I am not sure Java is even enabled…? The end result is the code in plaintext view on the site when I throw that in a custom HTML block. When I use a basic i-frame html it works fine, at least on Chrome, so I know the embed is being blocked by the other browsers (again, I am guessing because of their profuse dislike of i-frames):
<iframe width='853' height='480' src='https://my.matterport.com/show/FAKEID' frameborder='0' allowfullscreen allow='xr-spatial-tracking'></iframe>
Are there any fixes that don’t involve going full Dev SDK from matterport?
- The topic ‘Embedding a Matterport’ is closed to new replies.