Skip to content
This repository has been archived by the owner on Dec 6, 2018. It is now read-only.

[Question] Hosting code on own server #319

Open
CaioBrighenti opened this issue Jun 19, 2018 · 3 comments
Open

[Question] Hosting code on own server #319

CaioBrighenti opened this issue Jun 19, 2018 · 3 comments

Comments

@CaioBrighenti
Copy link

Perhaps this is a simpler issue than I realize, but I am somewhat new to HTML/JS and this seems to me to be a specific issue with this code. I am using the Google VR Viewer to embed 360 elements within my web-page.

Their documentation here is simple enough and setting up as laid out on their website works fine if I'm using media hosted on Google's domain as well. This the code I'm using that works just dandy:

<script src="https://storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>
<script>
  window.addEventListener('load', onVrViewLoad);
  function onVrViewLoad() {
    vrView = new VRView.Player('#vrview', {
    width: '100%',
    height: 480,
    image: 'https://storage.googleapis.com/vrview/examples/coral.jpg',
    is_stereo: true,
    is_autopan_off: true
    });
  }
</script>

However, I need to have the .js files hosted on my own server, as opposed to just linking to Google. So I tried downloading the script and using following code and I can't get it to work. Can anyone spot what's wrong?

<script src="build/vrview.min.js"></script>
<script>
  window.addEventListener('load', onVrViewLoad);
  function onVrViewLoad() {
    vrView = new VRView.Player('#vrview', {
    width: '100%',
    height: 480,
    image: '360/coral.jpg',
    is_stereo: true,
    is_autopan_off: true
    });
  }
</script>

For reference, the error I get is

Cannot GET /index.html?image=http://127.0.0.1:61060/360/coral.jpg&amp;is_stereo=true&amp;is_autopan_off=true&amp;

Thanks! Hopefully this isn't too dumb of a question.

@jjnxpct
Copy link

jjnxpct commented Aug 3, 2018

Did you figure this out? I'm new to this to and want to host js files on our own server to. Not sure why index.html is used to get the image... I'll keep searching and trying more ;-) Any help is appreciated.

@CaioBrighenti
Copy link
Author

@jjnxpct I have not actually, ended up going with a different 360 viewer for my project (which is a bummer, given how convenient this one seems to be). I can't even get the demos to work, and live pages that have other demos of vrview seem to be broken too so I suspect there's some unresolved issue going on.

@jjnxpct
Copy link

jjnxpct commented Aug 9, 2018

I now use https://pannellum.org/. Excellent script! Works out of the box and with a lot of options.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants