iOS issue with CORS using amazon S3

  • Hi, I'm having trouble using an Amazon S3 bucket, when I'm viewing the project from iOS device, not all images are loaded, panos are always loaded, but rest of the images are not, like thumbs, ... is anyone knowing how to solve this, I guess it was about the policy of CORS, but I already did try different settings without success, on android devices it's working like a charm... Thanks in advance

  • Hi,

    iOS has an caching bug related to CORS requests in some cases.

    The layer and css3d-hotspot images that will be sown on the screen are loaded by the browser by its own (as css-background image) - and that will be done by the browser always WITHOUT a 'crossOrigin' setting - while the krpano js-script needs to load the images WITH a 'crossOrigin' setting to get access to it's pixel sizes.

    And iOS is buggy here - it caches the images without the crossOrigin setting, but then when loading from the cache and trying the access the problem happens. Correct working browsers don't have that problem.

    A 'workaround' could be adding '?nocache=%$random%' to the image urls to disable the caching, then it should but with disabled caching = slower loading of course.

    For iOS it would be generally a good recommendation trying to avoid any cross-origin access, e.g. cross-origin video isn't working too in iOS.

    Best regards,
    Klaus

  • Hi Jordi,

    I too had that issue back in August

    https://krpano.com/forum/wbb/inde…72367#post72367

    In the end I could only get the thumbnails to show by leaving them with the tour and not up on S3 with the pano tiles.

    I had the panos folder as normal with the tour on the regular website hosting plus all the tile folders inside but each of those only contained the thumb.jpg

    The url in the scene xml was

    thumburl="panos/001.tiles/thumb.jpg"


    Then for the pano

    Code
    <preview url="path-to-my-S3-bucket/panos/001.tiles/preview.jpg" />
    
    
    		<image>
    			<cube url="path-to-my-S3-bucket/panos/001.tiles/pano_%s.jpg" />
    			<mobile>
    				<cube url="path-to-my-S3-bucket/panos/001.tiles/mobile_%s.jpg" />
    			</mobile>
    		</image>


    I used the code supplied by Klaus ( '?nocache=%$random%' ) for the 20 image galleries that I had in the tour as they too wouldn't display the images like the thumbnail issue but I needed these in the S3 bucket and not on the hosting so will have to make do with the no cache.

    Hope that helps.


    Andrew

Participate now!

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