I recently started creating a tvOS channel for my company. I did not have experence with iOS devices, Swift, or Obj-C before, however, I have started studying these to create the apps to be placed on Apple's App store.
After looking through the TVML stuff and all the different templates that are provided, I have a design that I want to implement. I was think I could use a php script to pull all of our different videos and episodes from our database and server, this would give the application a real time update. As we update our database, the script would in turn update the TVML/XML file with the new content in the correct areas. I will block out the url's being used but post my XMLHttpRequest code:
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "http://branches.globalsportsman.com/******", false);
xhttp.send();
return xhttp.responseText;
}This would be sync. request call, pulling back the response body as string. Which I then pass into presenter.js here:
var doc = Presenter.parser.parseFromString(resource, "application/xml");
return doc;I am getting the error that resource, here, is an invalid parameter. The systems works correctly if the TVML/XML is created by hand and sent in as a string. Maybe someone could give me insight on what is going wrong here. The php script is giving correctly formatted XML in browser, using the correct TVML syntax, I pastsed in the same XML into a variable and returned it to resource and it was fine.