如何解决在Afram ar中播放视频nft
我使用aframe和ar.js扫描照片并播放视频。扫描照片后,我在一页中有2张照片,有2个视频供播放。现在,当我扫描照片时,显示矩形时会显示视频。
- 扫描=> photo1.jpg ===和paly ===> video1.mp4
- 扫描=> photo2.jpg ===和paly ===> video2.mp4
这是我的代码:
<script src="https://cdn.jsdelivr.net/gh/aframevr/aframe@1c2407b26c61958baa93967b5412487cd94b290b/dist/aframe-master.min.js"></script>
<script src='https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js'></script>
<body style='margin : 0px; overflow: hidden;'>
<div class="arjs-loader">
<div>plase wiate ... </div>
</div>
<a-scene
vr-mode-ui="enabled: false;"
renderer='antialias: true; alpha: true; precision: mediump;'
embedded arjs='trackingMethod: best; sourceType: webcam; debugUIEnabled: false;'>
<a-nft
videohandler
type='nft'
url='https://ala.org.ir/ar/photo1'
smooth="true" smoothCount="10" smoothTolerance="0.01" smoothThreshold="5">
<a-assets>
<video src="https://ala.org.ir/ar/video1.mp4"
preload="auto" id="vid" response-type="arraybuffer" loop
crossorigin webkit-playsinline autoplay playsinline>
</video>
</a-assets>
<a-video
src="#vid"
position='0 0 0'
rotation="-90 0 0"
width='300'
height='175'
>
</a-video>
</a-nft>
<a-nft
videohandler
type='nft'
url='https://ala.org.ir/ar/photo2'
smooth="true" smoothCount="10" smoothTolerance="0.01" smoothThreshold="5"
>
<a-assets>
<video src="https://ala.org.ir/ar/video2.mp4"
preload="auto" id="vie" response-type="arraybuffer" loop
crossorigin webkit-playsinline autoplay playsinline>
</video>
</a-assets>
<a-video
src="#vie"
position='0 0 0'
rotation="-90 0 0"
width='300'
height='175'
>
</a-video>
</a-nft>
<a-entity camera ></a-entity>
</a-scene>
</body>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。