2012-06-03, 11:15
(2012-06-01, 23:32)Archigos Wrote: Once I get back home and start toying with this again, I imagine your example (along with Montellese's comment) something like these would work for the Volume? (I don't want to give exact percentages).Yes that should work.
Code:{"jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "increment"}, "id": 1}
{"jsonrpc": "2.0", "method": "Application.SetVolume", "params": { "volume": "decrement"}, "id": 1}
(2012-06-01, 23:32)Archigos Wrote: So, "id": "1" should be at the end of each command... I'm guessing it wouldn't hurt to just leave it there even when I'm done since the script outputs everything to a div which I'm hiding in the released version. Also, I think it was in the post, pages back, but I thought the id specified type, like "id": "1" was for video or is this just another area I misunderstood? (The posts were about adding images not in the library into a slideshow or something like that).The "id" we are talking about here comes from the JSON-RPC 2.0 specification and has nothing to do with XBMC itself. Generally JSON-RPC can't assure that when you send request A and then B that you will first receive the response for request A and then the response for request B. It could be the other way around. So by specifying a "unique" "id" value for every request you can use the "id" value returned in the response to match a request with a response. What most people do is just use an integer value and increment it with every request they make. the "playerid" in XBMC's Player methods are something totaly different and are very XBMC-specific.
(2012-06-01, 23:32)Archigos Wrote: I'll remove all the permissions and set the id's. So, something like the following should work for Mute then?Yes that should work.
Code:{"jsonrpc": "2.0", "method": "Application.SetMute", "params": {"mute": "toggle"}, "id": "1"}
(2012-06-02, 23:36)A guy Wrote: Hello. I'm sorry for being total idiot in this. I tried to do the HTTP posting thing, but it just isn't working out. I can understand the JSON syntax more or less, but I fail to pass the command to XBMC. Maybe some of you guys could show me how it's done in html or something for complete new to this thing. I'd really appreciate it. Thank you for your time.What do you mean by "through html"? If you want to write a webinterface for XBMC (or something similar web-based) you either need to use JavaScript (and send POST requests or use WebSockets (which are not available in Eden)) or you need another programming/scripting language like PHP or Python.
Edit: I tested around with REST client on chrome at the data I send works, does what it needs to do. However I just can't get it working with html, then again i don't know if I'm doing things correctly. Currently I'm just trying to post {"jsonrpc": "2.0", "method": "Input.Select", "id": 1} throught html. I'm very bad at improvising