I'm trying to embed a panorama created with Pano2VR on Moodle and it works in Firefox and Chrome but in Safari the player and skin load but the images don't, leaving a black screen and the web inspector gives me this error: Cross-origin image load denied by Cross-Origin Resource Sharing policy . I don't understand this since all the files including .html, .js, .xml and images folder are hosted on Moodle so I'm not pulling anything from other hosts. Also, what is weird is that this only happens when I use Version: 5.0.3 but when I use my older 3.1.4 version it's all ok.
Thanks for your help.
Greg
Cross-origin image load denied by Cross-Origin Resource Sharing policy
Hello Greg,
this is very odd. Can you please send me a link (as PM)? I tested CORS with Amazon S3 and for me this works as expected.
this is very odd. Can you please send me a link (as PM)? I tested CORS with Amazon S3 and for me this works as expected.
MfG, Thomas
-
- Posts: 11
- Joined: Wed Dec 21, 2016 11:48 am
Hi Thomas
Unfortunately, I cannot send any links as our Moodle pages require a username and password. Is there anything else I can provide you with?
Also, where would I find the CORS configuration? Is it in the .xml or .js file?
Bw
Greg
Unfortunately, I cannot send any links as our Moodle pages require a username and password. Is there anything else I can provide you with?
Also, where would I find the CORS configuration? Is it in the .xml or .js file?
Bw
Greg
OK, something of a late reply and hopefully will help others as it solved our issues with Safari browsers on the iMac, iPad and iPhones.
change it to:
I can't explain how or why very well, as I'm not that clever.. I think it's something to do with Safari seeking authenticity of the image(s) used.
Dom
- Find the 'pano2vr_player.js' code created by generating output
- Open this .js file with a text editor (notepad will do)
- Search for or find the term "crossOrigin"
Code: Select all
this.crossOrigin="anonymous";
Code: Select all
this.crossOrigin=use-credentials";
Dom
Didn't you forget one quotation mark?
Code: Select all
this.crossOrigin="use-credentials";
-
- Posts: 11
- Joined: Wed Dec 21, 2016 11:48 am
Thanks a lot for your reply. I came up with the same idea but simply deleted that part of the code and it worked. However, changing it to 'use-credentials' also works!
Thanks
Thanks
This method is a hack, but there is an API call that also survives a new player.
You can add the line
to the HTML page.
https://ggnome.com/doc/pano2vr/5/javascript-api/
You can add the line
Code: Select all
pano.setCrossOrigin("use-credentials");
https://ggnome.com/doc/pano2vr/5/javascript-api/
MfG, Thomas