Sie sind nicht angemeldet.

benji33

Fortgeschrittener

  • »benji33« ist der Autor dieses Themas

Beiträge: 244

Wohnort: France

Beruf: Senior Software engineer

  • Nachricht senden

1

Mittwoch, 29. Januar 2014, 15:01

Cross domain and krpano Javascript interface

Hi,

How to work with cross domains and the krpano javascript interface ?
I've some problems with get()/set()/call() methods called from JS script of the main HTML page, when main HTML page is on server A -and- XML + ressources (tiles/images) on a server B.

Is there a best practice to do something with cross domains ?

Thanks.

2

Mittwoch, 29. Januar 2014, 15:18

Hi,

the Same-origin policyof Javascript forbids a Javascript communication between different domains, but resources like xml or images files should be not affected from that. For the resources itself it's only important that the other server is sending the CORS header.

How are the xml and the images related to the Javascript interface in your case?

Best regards,
Klaus

benji33

Fortgeschrittener

  • »benji33« ist der Autor dieses Themas

Beiträge: 244

Wohnort: France

Beruf: Senior Software engineer

  • Nachricht senden

3

Mittwoch, 29. Januar 2014, 16:15

I'm currently doing some tests on 2 differents IP.

For xml and tiles, I can display them.
I've added a .htaccess into the data directory (tiles+images+xml) with

Quellcode

1
Header set Access-Control-Allow-Origin *
to enable html5 player compatibility.

Quellcode

1
2
3
4
<security cors="">
	<crossdomainxml url="http://192.168.1.201/crossdomain.xml" />
	<allowdomain domain="*" />
</security>
tag is not suffisent for HTML5 player but must be enabled for the Flash player.

4

Mittwoch, 29. Januar 2014, 16:25

Hi,

are you testing with Apache servers and were the headers sent correctly from the server? (the headers can be seen in the Firefox or Chrome developer tools).

Additionally you could also try:
<security cors="use-credentials" />

In some cases it seems the default anonymous CORS requests (cors="") are not enough...

Basically this should work of course - e.g. all panos on the page below are loading the tiles from external servers:
http://krpano.com/html5multires/

Best regards,
Klaus

Ähnliche Themen