startAR()

This function starts the augmented reality mode, if the device is compatible. Otherwise, displays a QR-Code which can be scanned with a compatible device to view the model in AR mode.


Parameters:

  • action: "startAR"

Example

<div class="vrxs-embed-wrapper">
  <iframe id="vrxsIframe"
          src="https://viewer.vrxs.de/embedded-model/ModelID?autoplay=true&controls=false&btn_start=false&enable_viewer_api=true"
          frameborder="0" allow="fullscreen" mozallowfullscreen="true" webkitallowfullscreen="true">

  </iframe>
</div>

<script type="text/javascript">
  const iframe = document.getElementById("vrxsIframe").contentWindow;

  function startAR() {
    iframe.postMessage({action: "startAR"}, "*");
  }

</script>
<button onclick="startAR()">
  Show in AR
</button>