首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我想模仿这一页。但我的屏幕上显示的是“点击或点击启动视频”。

我想模仿这一页。但我的屏幕上显示的是“点击或点击启动视频”。
EN

Stack Overflow用户
提问于 2021-10-26 13:37:34
回答 2查看 135关注 0票数 0

https://aframe.io/aframe/examples/boilerplate/360-video/

我是刚接触Aframe js的。所以,我想模仿这一页。我已经复制了整个代码,但它仍然不起作用。

代码语言:javascript
复制
<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>

编辑:

我在控制台日志中收到一个错误。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-10-27 01:00:28

在开始使用Aframe文档之前,您可能希望阅读它:

代码语言:javascript
复制
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.
票数 1
EN

Stack Overflow用户

发布于 2021-10-26 14:26:50

您似乎需要在服务器、nodejs、xampp等本地主机环境中打开HTML文件,因为当您将这个HTML文件拖放到浏览器中时,它装载了文件:// protocol和aframe无法加载资产等。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69724166

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档