barrygordon Wrote:I assume if I use the raw port I would just send
/jsonrpc {"jsonrpc": "2.0" . . . "id": 1}
Any help that will allow me to get started would be greatly appreciated.
I've just tested with the raw socket (using putty raw socket to 9090). Drop the /jsonrpc part. The return isn't compacted:
send:
Code:
{"jsonrpc":"2.0","method":"Player.GetActivePlayers","id":1}
received:
Code:
{
"id" : 1,
"jsonrpc" : "2.0",
"result" : {
"audio" : false,
"picture" : false,
"video" : false
}
}
This might be problematic because it looks like there will be no way of telling when the return has been processed. Maybe counting { and } until the difference = 0.
What is interesting are the announcements, this is what happens when I select a song using ordinairy controls:
Code:
{
"jsonrpc" : "2.0",
"method" : "Announcement",
"params" : {
"message" : "PlaybackStarted",
"sender" : "xbmc"
}
}
But I can't really find that much about the Announcements.
http://trac.xbmc.org/browser/trunk/xbmc/...nnouncer.h
I've also tested the "old" httpapi and it works just like before, I think some pre-beta nightly builds had a non working httpapi and I wrongly assumed it was dropped from Dharma.
Tolriq Wrote:And i reiterate my request that was discussed some times ago and mostly accepted, to getback some kind of thing similar to GetNowPlaying to avoid hamering XBMC with request (4 request per sec to get current player, volume , progress and media informations) that's a little too much
Tolriq.
Wouldn't it be possible to send multiple requests as one in an array as JSON-RPC 2.0 spec ("To send several Request objects at the same time, the Client MAY send an Array filled with Request objects.")
edit: Woops... TOPFS2 about arrays: When it will be added is not decided yet but hopefully for eden.
Nick8888 Wrote:1. working fine for me with whats in the wiki
Things I used in HTTP-API that I'm missing in JSON:
- SendKey
- GetCurrentlyPlaying (some items are missing in JSON)
- GetGuiStatus
- SetBroadcast
- ExecBuiltIn (ActivateWindow)
I'm using EventServer for 1 and 5, multiple requests to get parts from 2 and 4 (might be possible with JSON, hopefully someone will answer my previous question about it), dropped everything else for now.
And there are much more missing that I didn't use, but others probably do.
Topfs2, could you tell a little more about the announcements? Is it possible to get more announcements? Ifso how? Which announcements are there? And once again, amazing job with JSON-RPC. Can't wait until the last objects are added and array support is in!