W.Fre
W.Fre

Reputation: 1

Play a local sphere video by Aframe

Im trying to play a sphere video store locally in my laptop with Aframe platform. First, i used this video: https://ucarecdn.com/bcece0a8-86ce-460e-856b-40dac4875f15/ it worked, but when i downloaded this video and changed the links to local link: http://localhost/webvr/testvr.mp4/, it didnt work. My browser is Chrome version 56. This is the html code I'm experimenting with

<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.3.0/aframe.min.js"></script>
  <script src="https://rawgit.com/oscarmarinmiro/aframe-video-     controls/master/dist/aframe-video-controls.min.js"></script>
</head>

 <body>
   <a-scene>
  <a-assets>
    <video id="video_1" crossorigin           src="http://localhost/webvr/testvr.mp4/"></video>
  </a-assets>

  <a-camera position="0 0 5">
      <a-cursor id="cursor" color="yellow"></a-cursor>
  </a-camera>

  <a-videosphere src="#video_1" rotation="0 180 0"></a-videosphere>

  <a-entity video-controls="src:#video_1"></a-entity>

</a-scene>

Upvotes: 0

Views: 600

Answers (2)

creatorman
creatorman

Reputation: 1

I had to run a local server on my laptop instead of opening the folder directly in my browser when I was developing with A-frame. In the event you use Linux and have python 3 installed, that would be: 1. In a terminal, navigate to the folder where your index.html and the video etc are in. 2. Then run the start the server by running the command: python3 -m http.server

I'm not sure where I read that this was the case, perhaps only for linux computers, when webdeveloping locally. But perhaps using a server somewhat like this might help? EDIT: it was mentioned here: https://aframe.io/docs/0.8.0/introduction/faq.html#why-does-my-asset-e-g-image-video-model-not-load

Upvotes: 0

mechacactuar
mechacactuar

Reputation: 21

Try this:

src="/webvr/testvr.mp4"

Your video is stored locally so you don't need the localhost part.

Upvotes: 2

Related Questions