2012-06-03, 11:39
(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.I know the feeling, I was in the same boat very recently. It took days but I was able to get it working through a JavaScript I wrote that uses the new Websocket in the Pre-Frodo nightly builds. If you're using a recent version I'm more than willing to share the code... (it sends via PHP, but 'may' be able to be modified easy for straight HTML, however Montellese's comment hints that straight HTML may not work anyway). I'm just curious, are you just doing this for personal internal use or for a project that will be released to the community? The reason I'm asking is if you want to help contribute to the community, maybe we can collaborate a little on the project I'm working on. PM me if you're interested in helping or just need the *.js and *.php file to get it working.
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
(2012-06-03, 11:15)Montellese Wrote:Thanks for the added info... I noticed the commands I had in that post worked after I got home to test, just forgot to post a thank you at that point. Now that I've managed to semi-wrap my head around getting the commands to work the way I want, now I just need to learn how to either handle or format the returned info into something useful for the end users.(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"}