Inject HTML Example

Fork this template and document the steps for reproducing a bug.

by guillermo_matterport

HTML

<html>

  <head>
    <script src="https://static.matterport.com/showcase-sdk/2.0.1-0-g64e7e88/sdk.js"></script>
  </head>

  <body>
    <iframe id="showcase" title="test" width="600" height="454" frameBorder="0" allowFullScreen allow="xr-spatial-tracking" src="https://showcase-next.matterport.com/show?m=LMbQHfCxUoc&play=1&version=3.1.30.0-2-g40b72451f"></iframe>
  </body>

</html>

JavaScript

var iframe = document.getElementById('showcase');
var jsFiddleKey = "a8a9d13f72124cf6865af11c42a843a1";
var version = "3.8";


const main = async () => {
	const sdk = await window.MP_SDK.connect(iframe, jsFiddleKey, version);
  console.log('SDK Connected', sdk);
  
  await sdk.App.state.waitUntil((state) => state.phase === sdk.App.Phase.PLAYING);
};

main();