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.

  • 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

    Code
    Header set Access-Control-Allow-Origin *

    to enable html5 player compatibility.

    Code
    <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.

  • 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:
    https://krpano.com/html5multires/

    Best regards,
    Klaus

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!