https://aframe.io/aframe/examples/boilerplate/360-video/
我是刚接触Aframe js的。所以,我想模仿这一页。我已经复制了整个代码,但它仍然不起作用。
<html>
<head>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
</head>
<body>
<a-scene inspector="" keyboard-shortcuts="" screenshot="" vr-mode-ui="" device-orientation-permission-ui="">
<a-assets>
<video id="video" autoplay="" loop="" crossorigin="anonymous" playsinline="" webkit-playsinline="" src="https://bitmovin.com/player-content/playhouse-vr/progressive.mp4">
</video>
</a-assets>
<a-videosphere rotation="0 -90 0" src="#video" play-on-click="" material="" geometry="" scale="">
</a-videosphere>
<a-camera camera="" position="" rotation="" look-controls="" wasd-controls="">
<a-entity position="0 0 -1.5" text="align:center;
width:6;
wrapCount:100;
color: white;
value: Click or tap to start video" hide-on-play="#video">
</a-entity>
</a-camera>
</a-scene>
<div id="highlighter--hover-tools" style="display: none;">
<div id="highlighter--hover-tools--container">
<div class="highlighter--icon highlighter--icon-copy" title="Copy"></div>
<div class="highlighter--separator"></div>
<div class="highlighter--icon highlighter--icon-change-color" title="Change Color"></div>
<div class="highlighter--separator"></div>
<div class="highlighter--icon highlighter--icon-delete" title="Delete"></div>
</div>
</div></body>
</html>编辑:

我在控制台日志中收到一个错误。
发布于 2021-10-27 01:00:28
在开始使用Aframe文档之前,您可能希望阅读它:
Use a Local Server
For the options below, we should develop projects using a local server so that files are properly served. Options of local servers include:
Downloading the Mongoose application and opening it from the same directory as your HTML file.
Running python -m SimpleHTTPServer (or python -m http.server for Python 3) in a terminal in the same directory as your HTML file.
Running npm install -g live-server && live-server in a terminal in the same directory as your HTML file.
Once we are running our server, we can open our project in the browser using the local URL and port which the server is running on (e.g., http://localhost:8000). Try not to open the project using the file:// protocol which does not provide a domain; absolute and relative URLs may not work.发布于 2021-10-26 14:26:50
您似乎需要在服务器、nodejs、xampp等本地主机环境中打开HTML文件,因为当您将这个HTML文件拖放到浏览器中时,它装载了文件:// protocol和aframe无法加载资产等。
https://stackoverflow.com/questions/69724166
复制相似问题