Building a basic remote using the HTTP API?
#1
Question 
I'm playing around with the XBMC Web API, and I'm running into a problem. I spent about an hour searching last night, but since I'm new to this, I'm not sure what exactly I'm looking for.

I build a simple web based remote. It is not hosted on the XBMC, but on my phone. When I hit any of the buttons (up, down, left, right, select, play, stop), it performs that function, but redirects me to a page that just says "OK", which I guess is by design. If I hit back, I can hit the next button without a problem.

I guess what I need is a way to send the command without actually leaving the main page. I'm assuming I need to use javascript to send the command and get the response without leaving the page, but I'm not sure what kind of function I should be looking for.

Anyone run into this before? Anyone have any pointers?

Thank you.
Reply
#2
Are you using some sort of scripting language on the server (PHP ASP etc) to generate your pages, or are you trying to use static HTML and javascript only?

If you are using a script language on the server, an AJAX call back to the script would be a good way to go.

For static HTML, there are a few ways to accomplish what you are looking for. An easy to implement one would be an iframe (either 1x1 or hidden inside a div with display style of none if you do not want it visable) Give the ifram an id, and use document.getElementById('IframeID').src="XBMC http api";
Reply
#3
I actually figured it out. I was using a static HTML page, I want to be able to use it on any xmbc, mine or my friends without needing the server side code.

It's very basic, used to select items, play/pause and adjust volume.

I ended up using XMLHttpRequest to get the job done.
Reply

Logout Mark Read Team Forum Stats Members Help
Building a basic remote using the HTTP API?1