Why does videosphere show up locally, but not on gh-pages?

115 views Asked by At

I have a videosphere that shows up locally, but pushing it to gh-pages, the video doesn't show.

There's no 404 error that the file is not there and I am using git LFS for the mp4 video (it's a 360 video, so quite large).

https://github.com/ybinstock/GreatEscape360

<html>

<head>
  <title>Great Escape</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  <meta name="mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
  <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui">

  <script src="https://aframe.io/releases/0.4.0/aframe.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>

</head>
<body>


<a-scene>
  <a-assets>
    <video id="greatescapevideo" autoplay loop="true" src="video2.mp4"> </video>
    <img id="logo" src="logo.png">
    <img id="slide1" src="slide1.png" >
    <img id="slide2" src="slide2.png" >
    <img id="slide3" src="slide3.png" >
    <img id="slide4" src="slide4.png" >
    <img id="slide5" src="slide5.png" >
  </a-assets>

  <a-camera wasd-controls="enabled: false"> </a-camera>

  <a-videosphere src="#greatescapevideo"></a-videosphere>

  <a-image id="logo" class="logo" src="#logo" position="0 2 -2" rotation="0 0 0"></a-image>
  <a-image id="logo" class="logo" src="#logo" position="1 2 2"  rotation="0 180 0"></a-image>
  <a-image id="logo" class="logo" src="#logo" position="-2 2 0" rotation="0 90 0"></a-image>
  <a-image id="logo" class="logo" src="#logo" position="2 2 0" rotation="0 -90 0"></a-image>

  <a-image id="slide1" class="slide1" src="#slide1" position="0 2 -2" rotation="0 0 0" ></a-image>
  <a-image id="slide1" class="slide1" src="#slide1" position="1 2 2"  rotation="0 180 0" ></a-image>
  <a-image id="slide1" class="slide1" src="#slide1" position="-2 2 0" rotation="0 90 0"></a-image>
  <a-image id="slide1" class="slide1" src="#slide1" position="2 2 0" rotation="0 -90 0"></a-image>

  <a-image id="slide2" class="slide2" src="#slide2" position="0 2 -2" rotation="0 0 0" ></a-image>
  <a-image id="slide2" class="slide2" src="#slide2" position="1 2 2"  rotation="0 180 0" ></a-image>
  <a-image id="slide2" class="slide2" src="#slide2" position="-2 2 0" rotation="0 90 0"></a-image>
  <a-image id="slide2" class="slide2" src="#slide2" position="2 2 0" rotation="0 -90 0" ></a-image>

  <a-image id="slide3" class="slide3" src="#slide3" position="0 2 -2" rotation="0 0 0" visible="false"></a-image>
  <a-image id="slide3" class="slide3" src="#slide3"position="1 2 2"  rotation="0 180 0" visible="false"></a-image>
  <a-image id="slide3" class="slide3" src="#slide3" position="-2 2 0" rotation="0 90 0" visible="false"></a-image>
  <a-image id="slide3" class="slide3" src="#slide3"position="2 2 0" rotation="0 -90 0" visible="false"></a-image>

  <a-image id="slide4" class="slide4" src="#slide4" position="0 2 -2" rotation="0 0 0" visible="false"></a-image>
  <a-image id="slide4" class="slide4" src="#slide4" position="1 2 2"  rotation="0 180 0" visible="false"></a-image>
  <a-image id="slide4" class="slide4" src="#slide4" position="-2 2 0" rotation="0 90 0" visible="false"></a-image>
  <a-image id="slide4" class="slide4" src="#slide4" position="2 2 0" rotation="0 -90 0" visible="false"></a-image>

  <a-image id="slide5" class="slide5" src="#slide5" position="0 2 -2" rotation="0 0 0" visible="false"></a-image>
  <a-image id="slide5" class="slide5" src="#slide5" position="1 2 2"  rotation="0 180 0" visible="false"></a-image>
  <a-image id="slide5" class="slide5" src="#slide5" position="-2 2 0" rotation="0 90 0" visible="false"></a-image>
  <a-image id="slide5" class="slide5" src="#slide5" position="2 2 0" rotation="0 -90 0" visible="false"></a-image>

</a-scene>


</body>
<script src="app.js"></script>

</html>
2

There are 2 answers

2
Kieran F. On

The quick answer is don't use github pages for video hosting.

The longer answer is, when I check https://ybinstock.github.io/GreatEscape360/video2.mp4 it returns only 133 bytes which is obviously not correct. It is odd since the file's page in the github GUI does allow you to download the entire file: https://github.com/ybinstock/GreatEscape360/blob/master/video2.mp4

So we can see the file is successfully placed in your repo but github pages won't serve it. The only solution I can suggest is another third-party file host.

2
ngokevin On

You need a CDN in front of GitHub pages if you want to serve consumable media files. Try using rawgit.com