JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-01 Tuesday, May 1st 2012: Commit: 5cc59fd88149927ae708
RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-01 With streaming audio the skins can pick up additional information (such as artist and song name). Is it possible to make that available? Atm all you get is the name of the stream as the label. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-01 With what version of XBMC and the JSON-RPC API did you try this? I added the following commit a while back which should provide more info for non-library items through Player.GetItem: https://github.com/xbmc/xbmc/commit/73fd7b21ce4bc5d53c7e37e497a64132648b3110 RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-01 This is in Eden. I just tried it in Frodo and get the same. For reference: Code: {"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "duration", "thumbnail", "file", "fanart", "streamdetails"], "playerid": 0 }, "id": 1} Code: {"id":1,"jsonrpc":"2.0","result":{"item":{"fanart":"special://masterprofile/Thumbnails/Video/Fanart/515043c5.tbn","file":"shout://streamer-dtc-aa01.somafm.com:80/stream/1018","label":"SomaFM Groove Salad","thumbnail":"","title":"","type":"unknown"}}} RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-04 Friday, May 4th 2012: Commit: 0bd7924d87f00059a9b4
I'll update the wiki page on JSON-RPC API v5 ASAP but make sure to take a close look at the JSON schema for the SetFooDetails methods so you don't mess up your (and possibly other people's) libraries RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-04 Nice. Fingers crossed for webserver: image transformation handler soon I'm using Frodo with Firefox and I think the Content-Type change has broken things. It appears that Firefox adds "; charset=UTF-8" to the Content-Type. Bug report. Chrome and IE don't do this and all the JSONRPC requests work fine. Same thing in Firefox gives: Code: NetworkError: 415 Unsupported Media Type Did you get a chance to check on the details of audio web streams whilst I'm here? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-04 (2012-05-04, 18:06)Mizaki Wrote: Nice. Fingers crossed for webserver: image transformation handler soonjmarshall claimed that PR and will adjust it's implementation so might still be a while. (2012-05-04, 18:06)Mizaki Wrote: I'm using Frodo with Firefox and I think the Content-Type change has broken things. It appears that Firefox adds "; charset=UTF-8" to the Content-Type. Bug report. Chrome and IE don't do this and all the JSONRPC requests work fine. Same thing in Firefox gives:Should be fixed with https://github.com/xbmc/xbmc/commit/75fda62a6b17c144b12ef52c3026b6cb9784be76 (2012-05-04, 18:06)Mizaki Wrote: Did you get a chance to check on the details of audio web streams whilst I'm here?As I don't use any audio web streams or similar addons it always takes me a while to look into those things. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-05 That's great, thanks. I don't use them either but Martijn was bugging me RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - sjroesink - 2012-05-06 I'm having trouble finding out how the websocket functionality works. Maybe it lacks documentation because websocket support is pretty new (and maybe unstable), but it would be great if someone could point me in the right direction. Thusfar I've got the following: Code: var xbmcSocket = new WebSocket('ws://localhost:9090/jsonrpc'); Now I would also like to send commands using the websocket. So my initial though was: Code: xbmcSocket.send({ Code: { RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-06 You are probably the first to try and use the new websocket functionality (after me) so first thanks for the feedback. Have you tried other JSON-RPC methods like JSONRPC.Ping etc? I have to admit that JSONRPC.Introspect is a bit of a loose candidate depending on the browser/websocket-implementation is used because of the huge amount of data it returns. During my testing I found out that there are browsers who can handle literally any amount of result data you throw at them while others have a fixed limit (which is pretty stupid considering that WebSocket supports fragmented messages). Thanks again for the feedback. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - sjroesink - 2012-05-06 Thanks for the fast response. I did try other methods. They all give the same parse error. Is there any way I can provide more information to make the debugging easier? I'm not sure how to debug websockets. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-06 Neither am I. I just ran latest XBMC (from master not a nightly build, but shouldn't make a difference) and used the websocket demo on websocket.org, opened a websocket to XBMC and ran JSONRPC.Ping, JSONRPC.Version and VideoLibrary.GetMovies without a problem. EDIT: What browser are you using and are you using any framework for websockets? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - sjroesink - 2012-05-06 When using Firefox, I can't get the websocket.org demo to connect to the websocket. In Chrome I can. Via the demo I found out I had to send the JSON encoded string instead of the actual object (I tried this before using the Introspect method, but this gave me the error "Received unexpected continuation frame."): Code: var xbmcSocket = new WebSocket('ws://localhost:9090/jsonrpc'); This does work! BTW: The error "Received unexpected continuation frame." also occurs when I start playing a movie. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-06 That's funny. I was just about to post I was having problems. I've been trying on and off for a few days, I'm doing basically the same thing but I don't get a connection. It tries to open and then after a while I get a closed message and error "Firefox can't establish a connection to the server at ws://10.0.0.101:9090/jsonrpc". Here is the simple code: Code: wsListener: function() { EDIT: Just thought I'd try the websocket.org demo. Works in Chrome but not in FF. Error in log: Code: 10:39:44 T:2874841968 INFO: WebSocket [RFC6455]: invalid "connection" received EDIT, EDIT: Okay and now Chrome is working fine. Maybe because I just allowed UPnP access? I'll leave all this here for any searchers it might help. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-05-06 Ah right I thought the websocket send method would take care of the stringification of the JSON object. Yes a websocket is just an extended TCP socket so you'll need to pass in everything as a string. Back when I implemented this there was no browser who supported the final RFC6455 implementation yet so I could only test against the latest draft. Maybe there's a bug in there. The only thing you should have to enable in the settings is "Allow programs on this system to control XBMC" (and "Allow programs on other systems to control XBMC" if that's what you want)). |