google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.71k stars 799 forks source link

Can't open url: intent://arvr.google.com while trying to access3d file in the ar #4558

Closed viniith21 closed 8 months ago

viniith21 commented 8 months ago
<div class="container">
  <model-viewer
    id="model"
    alt="3D MODEL"
    src=""
    auto-rotate
    shadow-intensity="1"
    camera-controls
    touch-action="pan-y">
  </model-viewer>
  <div class="model-info">
    <label for="title">Model Title</label>
    <p id="title">Loading...</p>
    <label for="description">Model Description</label>
    <p id="description"></p>
  </div>
</div>

<script>
  const urlParams = new URLSearchParams(window.location.search);
  const modelUrl = urlParams.get('model');
  const metadataString = urlParams.get('metadata');

  if (modelUrl) {
    const modelViewer = document.querySelector('model-viewer');
    modelViewer.src = modelUrl;
  }

  if (metadataString) {
    const metadata = JSON.parse(decodeURIComponent(metadataString));
    const title = metadata.title || 'No Title';
    const description = metadata.description || 'No Description';

    const titleElement = document.getElementById('title');
    titleElement.textContent = title;

    const descriptionElement = document.getElementById('description');
    descriptionElement.textContent = description;
  }
</script>

i am trying to access the 3D file from the server i got the Preview of the 3d but when i try to access it in the ar it shows me this error Can't open url: intent://arvr.google.com/scene-viewer/1.0?mode=ar_preferred&disable_occlusion=true&file=https%3A%2F%2Fcdn-luma.com%2Fede55bce1c8f80f445e9ada9adc27ff4ec7b8c463f370c14c5e7ae9302a29d06%2FLord_Krishna_textured_mesh_glb.glb#Intent;scheme=https;package=com.google.ar.core;action=android.intent.action.VIEW;S.browser_fallback_url=https%3A%2F%2Fluma-modal-viewer.netlify.app%2F%3Fmodel%3Dhttps%3A%2F%2Fcdn-luma.com%2Fede55bce1c8f80f445e9ada9adc27ff4ec7b8c463f370c14c5e7ae9302a29d06%2FLord_Krishna_textured_mesh_glb.glb%26metadata%3D%7B%2522title%2522%3A%2522Lord%2520Krishna%2522%2C%2522status%2522%3A%2522complete%2522%7D%23model-viewer-no-ar-fallback;end; please help me out how to solve this issue