Wednesday, October 2, 2013

Skeleton Tracking - HTML Frontend

Now that I've finished the C# server code and skeleton tracking, I have started the html front end to retrieve the kinect data and create spatial audio sound with it.

I was going to test natively on Windows however you can not make an ajax call using the file protocol and ajax is required to load the sound SO it was back to the VM to use webpy and a quick python server to host my html code. Even though I have no need (yet) for server-side python I at least had to have something hosting my html and sound file so that I could make an ajax request to it.

I've created a pretty basic html page that will simply make get requests to the C# server at the same interval as the previous ballbeam code did. The page has two buttons, one to stop the python service and one to start playing the audio. There are no visuals yet but the code to pan the audio based on the retrieved location is in place. After working through a few  bugs in the code, I have arrived at this error message:

Uncaught NetworkError: A network error occurred. X.cs.clemson.edu:8080/:64
XMLHttpRequest cannot load http://Y:8080/position. Origin http://X.cs.clemson.edu:8080 is not allowed by Access-Control-Allow-Origin. X.cs.clemson.edu:8080/:64


From this stack overflow question, it sounds like I need to add something to the header of my C# servers response to allow cross-domain requests from any (or at least X) domain. However, I can use "wget" to retrieve the C# server response data just fine from X. Perhaps wget uses a different outgoing port and that's why its able to get through? Either way I have two things to try: 1) I can still try setting the header data to allow all cross-domains as per stack overflow 2) I can look into why wget works and see if I can apply that too my ajax call.

No comments:

Post a Comment