Jump to content

loading image from facebook


Brendan
 Share

Recommended Posts

I'm trying to load an image url grabbed from the Facebook graph api for use in Phaser. (i want to use the players profile picture in game) I can get the url fine, when i try and apply the image to the sprite i get a cross origin error:

 

Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at xxxxxx may not be loaded

 

I have had this working on an earlier version of phaser without a problem. Can anyone suggest what the issue may be?

Link to comment
Share on other sites

Maybe this can help:

http://www.html5gamedevs.com/topic/7713-how-to-get-around-cors-in-phaser-when-all-assets-are-hosted-on-a-cdn/

 

 

 

Hmmm, I cannot tell you about the server because the guy is gone. 

 

But I am sure this solved it and it had nothing to do with the server  (or atleast, we exhausted server options).
 

//load the preloader stuff
this.load.crossOrigin = "Anonymous";
this.load.image("background", "blah/background.png");

OR If you are using chrome / canary for testing hit this extention to cancel out CORS.  If that does not work, then for sure it has to do with the server.

https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en

Note that I have no idea what any of it means, but our CORS issue is gone and that is good for me  :P

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...