srdjan Posted August 5, 2016 Share Posted August 5, 2016 Hi, I am having problem loading texturepacker .json file on android device. Pixi code: var loader = Loader.add('images/sprites.json').once('complete', onAssetsLoaded).load(); Here is the error message: chromium: [INFO:CONSOLE(0)] "XMLHttpRequest cannot load content://com.company.test.AVC.files/assets/images/sprites.json. Cross origin requests are only supported for protocol schemes: http, data, chrome, https.", source: content://com.company.test.AVC.files/assets/index.html (0) My app is packed into apk using Corona SDK. (I packed html projects before w/o problems) This is my first Pixi project displayed inside Corona's WebView... Are there known issues between Corona and Pixi? Quote Link to comment Share on other sites More sharing options...
xerver Posted August 7, 2016 Share Posted August 7, 2016 This isn't a pixi issue, the problem is right there. You are doing a crossx domain request (the protocol/domain is different) but x-domain requests are disabled for any protocol except http, data, chrome, and https. Nothing we can do about this on the loader, you would need to reconfigure the browser which I don't know if Corona lets you do. You would have to talk to them. Quote Link to comment Share on other sites More sharing options...
srdjan Posted August 7, 2016 Author Share Posted August 7, 2016 Thank you xerver I am afraid that corona can't help. It uses android browser to displaying web content... I don't think that chrome allows that on devices. Maybe pixie can help? Is it possible to pass object which contains sprite data to Loader instead of path to json file? (sprite data is from Texturepacker) Something like: Loader.add({my object}) In that case I don't have to worry about that CORS thing... Quote Link to comment Share on other sites More sharing options...
xerver Posted August 8, 2016 Share Posted August 8, 2016 Open an issue on the loader repo: https://github.com/englercj/resource-loader Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.