- Home /
Got "no crossdomain.xml policy" while loading a local assetbundle by WWW on a web player
I try to use WWW class and a relative path to load a local assetbundle on a web player.
WWW www = new WWW("./WebPlayer/BigTree.unity3d");
The error message I got is "Rejected because no crossdomain.xml policy file was found."
The relative path should be correct because I can normally run my program on some computers. However, I got this error message on few computers.
I am wondering that if I can load a assetbundle locally ? If I can do it, do I use the right way to do it ? Does WWW class always use socket to load files even if the file is in a local file system ?
My OS is Windows XP, and the web player version is 3.4.1f5. In addition, when I got this error message, the Application.dataPath is "file:/". I am not sure if this is relevant to this problem, but I try to give as much information as I can.
Thank you.
Answer by Graham-Dunnett · May 07, 2013 at 08:42 PM
You need to give the full URL including the http and server host. Relative URNs are not supported. The webplayer has no access to the file system of the client where it is running. You should not expect to be able to load asset bundles from the file:// protocol. Application.dataPath
is returning file://
presumably because you are launching the webplayer using an html
document on your computer. Asset bundles can only be fetched from webservers. The doc page for asset bundles shows how to load them in the editor if you are testing them.
Your answer
Follow this Question
Related Questions
How to import the object from server to unity 2 Answers
Download assetbundles with Webapp 0 Answers
Crossdomain.xml, same server but i get 'Rejected' error ... 2 Answers
PC build cant download assetbundle from server 0 Answers
Asset Bundle Download Problem 0 Answers