首页 > 解决方案 > Aframe 示例网络摄像头,但显示错误

问题描述

我尝试在我的网络上使用 A-frame 示例。但是,在移动设备上,出现错误。这是警报消息。

Webcam Error. Not Readable Error. Message:Could not start video source

我把这个例子源。我不知道,为什么一直显示此警报消息。我只是想在我的手机上测试一个例子。(我在这个网站上找到了这个例子 。https://github.com/AR-js-org/AR.js/blob/master/aframe/examples/marker-based/basic.html


<script src="https://aframe.io/releases/1.0.0/aframe.min.js"></script>
<script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
<style>
     .arjs-loader {
       height: 100%;
       width: 100%;
       position: absolute;
       top: 0;
       left: 0;
       background-color: rgba(0, 0, 0, 0.8);
       z-index: 9999;
       display: flex;
       justify-content: center;
       align-items: center;
     }

     .arjs-loader div {
       text-align: center;
       font-size: 1.25em;
       color: white;
     }
   </style>
<div style='margin : 0px; overflow: hidden;'>
<a-scene embedded arjs>
   <a-marker preset="hiro">
      <a-entity
        position="0 -0.5 0.5"
        rotation="90 0 0"
           scale="0.05 0.05 0.05"
           gltf-model="https://arjs-cors-proxy.herokuapp.com/https://raw.githack.com/AR-js-org/AR.js/master/aframe/examples/image-tracking/nft/trex/scene.gltf"
           ></a-entity>
       </a-marker>
       <a-entity camera></a-entity>
       </a-scene>
</div>

标签: aframe

解决方案


推荐阅读