当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - Google VR video doesn't load

问题描述:

I'm using Google VR View for the web to load in a 360 video. But when I load the video, it says Error, Render: video load error: [object event]

This is what the console shows:

When I load the example video from Google's url, it works like a charm: https://storage.googleapis.com/vrview/examples/video/congo_2048.mp4

This is the code I'm using (with the same video, but stored on my site):

<div id="vrview"></div>

<script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>

<script>

window.addEventListener('load', onVrViewLoad)

function onVrViewLoad() {

var vrView = new VRView.Player('#vrview', {

video: 'video/congo.mp4',

is_stereo: true

});

};

</script>

[Edit] Even with the full link to the video on my domain, the video still doesn't work.

[Edit 2] This is the file structure:

  • css
  • img
  • js
  • video

    • congo.mp4
  • index.html

Thanks for helping me out!

网友答案:

EDIT:

Set CORS headers - see http://enable-cors.org/server.html for server specific details

网友答案:

Use two required parameters (width, height), then it works well without setting CORS headers.

However, I am now struggling to solve similar problem in the case of handling local or youbute 360 video. i.e. I can run just a provied example file but not real 360 files. Do you have any progress?

My post: how to play youtube 360 videos using vrview-web

cf link. http://vcml.cafe24.com/humble.php

    window.addEventListener('load', onVrViewLoad);

    //It works
    function onVrViewLoad() {

      var vrView = new VRView.Player('#vrview', {width: '100%',height: 600,video: 'http://storage.googleapis.com/vrview/examples/video/congo_2048.mp4',is_stereo: true,
      });
      
      //Now I'm struggling. Not working
      var vrView1 = new VRView.Player('#vrview1', {width: '100%',height: 600,video: 'https://www.youtube.com/embed/OkLa7jkFXpU',//video: 'http://vcml.cafe24.com/video.mp4',is_stereo: false,
      });
    }
Congo Video
  <div id="vrview"></div>Youtubu Video
  <div id="vrview1"></div>
网友答案:

Do not use this script <script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>,You have use <script src="vrview-master/build/vrview.js"></script> from the sample zip file.

分享给朋友:
您可能感兴趣的文章:
随机阅读: