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
|
- wuench - 2011-02-09 vidtech Wrote:Hi guys, new round these parts, Would you consider expanding your ticket to include the implementation of all Action commands? I don't think those 5 commands would be enough to fully control the interfaces. For example, in my experience, you can't close dialogs or navigate back to screens without Back, Close_Dialog, and Parent_Dir. Here is a list of all the ones I have implemented using the current HTTP API interface in my driver (some are redundant with the VideoPlayer/AudioPlayer commands) Looking forward to the day I can abandon the HTTP API... Code: Action(1); ACTION_MOVE_LEFT - Tolriq - 2011-02-09 wuench Wrote:Would you consider expanding your ticket to include the implementation of all Action commands? I don't think those 5 commands would be enough to fully control the interfaces. For example, in my experience, you can't close dialogs or navigate back to screens without Back, Close_Dialog, and Parent_Dir. Here is a list of all the ones I have implemented using the current HTTP API interface in my driver (some are redundant with the VideoPlayer/AudioPlayer commands) Looking forward to the day I can abandon the HTTP API... For those you can use eventserver Works well even if all JSON would be better. I think the full list is needed, as all users will need some specific buttons For example i need playdrive, eject, myvideo, mymusic ... - panzaeron - 2011-02-13 Hi guys, I tried to add some mp3-streams to the playlist with this command Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "file" : "/home/xbmc/.xbmc/userdata/playlists/music/radio.m3u"}, "id": 1}' http://192.168.0.24:8080/jsonrpc After this I tried to add the streams one by one with this command: Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "file" : "http://gffstream.ic.llnwd.net/stream/gffstream_mp3_w49a", "label" : "Bremen 4"}, "id": 1}' http://192.168.0.24:8080/jsonrpc Is it possible with the json-interface to:
- topfs2 - 2011-02-13 if you want to add the content of a playlist you should do Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "playlist-file" : "/home/xbmc/.xbmc/userdata/playlists/music/radio.m3u"}, "id": 1}' http://192.168.0.24:8080/jsonrpc - Jason102 - 2011-02-14 A person using the latest git version of XBMC was having problems with PseudoTV. Looking at his log, I see that the duration field was not returned in the GetDirectory JSON call that's done. The field is specified in the call along with others, and the others return properly. Has the name of this field changed? If it should work the same as it does in Dharma, I will file a bug report. - topfs2 - 2011-02-14 Jason102 Wrote:A person using the latest git version of XBMC was having problems with PseudoTV. Looking at his log, I see that the duration field was not returned in the GetDirectory JSON call that's done. The field is specified in the call along with others, and the others return properly. Has the name of this field changed? If it should work the same as it does in Dharma, I will file a bug report. Fairly certain it has not changed, is it just PseudoTV or is it all add-ons? Because if its just PseudoTV it could be that it has stopped giving that info? - Jason102 - 2011-02-14 I honestly don't know whether other plugins have this issue or not. Here is the code: Code: json_query = '{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "%s", "media": "%s", "recursive": "%s", "fields":["duration","tagline","showtitle","album","artist","plot"]}, "id": 1}' % ( self.escapeDirJSON( dir_name ), media_type, recursive ) The results in the log show that, in Dharma, duration is properly returned as an int value along with the appropriate other fields (depending on the media type, of course). In the repository XBMC, though, the other fields appear but duration is not there. - topfs2 - 2011-02-14 Jason102 Wrote:I honestly don't know whether other plugins have this issue or not. Here is the code: Open a ticket with full Debug Log and if possible a test script - panzaeron - 2011-02-14 @topfs2 Thanks, this works fine But I have an other question: With a fresh booted xbmc, I add to my empty playlist eight streams/songs, this works now (many thanks). If I try to play the first song I use this json-rpc commands: Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Play", "params": { "songid" : "0"}, "id": 1}' http://192.168.0.24:8080/jsonrpc Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Play", "params": "0", "id": 1}' http://192.168.0.24:8080/jsonrpc - Montellese - 2011-02-15 Generally both of these requests should be valid. If you provide no "songid" field or 0 as a value (which is the case in your example) it should simply start playing the playlist. At a quick glance I couldn't figure out how AudioPlaylist.Play could (in any case) return "Failed to execute method" so I'll have to take a closer look when I get home today. Did you check if the playlist actually contained the eight streams/songs you added using json rpc (with AudioPlaylist.GetItems())? - grywnn - 2011-02-15 Hi everyone, i've just stumbled over a strange bug: "Player.GetActivePlayers" times out if an addon has the virtual keyboard opened. How to reproduce: - Take an addon with an integrated search feature, like YouTube - In the youtube addon, got to Search->Search... - the virtual keyboard will pop up. - now, with the keyboard opened, use your favorite script / curl whatever and do a Player.GetActivePlayers => timeout. - close the keyboard and everything's back to normal. I've tested this with different addons, same result. I don't know if this is JSON or rather core related (suspect the later one), but i thought i'd post it here anyway. Edit: Tested with XBMC 10.0 running on OS X - Montellese - 2011-02-15 grywnn Wrote:Hi everyone, Thanks for the detailed description. Could you 1. create a bug ticket on trac for this? 2. turn on debug logging (Settings -> System -> Debugging), re-run the steps you described to reproduce the problem and then attach the debug log to the trac ticket? That would help a lot to narrow down the problem. Thanks. - erhnam - 2011-02-15 topfs2, How hard would it be to implement a function that will allow users to retrieve all audio devices and reconfigure them? - grywnn - 2011-02-15 Montellese Wrote:1. create a bug ticket on trac for this?Done. - panzaeron - 2011-02-15 @Montelese I do the following: Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "playlist-file" : "/home/xbmc/.xbmc/userdata/playlists/music/Radio.m3u"}, "id": 1}' http://192.168.0.24:8080/jsonrpc Code: { and the result from: Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.GetItems", "params": { "fields": ["title","artist"] }, "id": 1}' http://192.168.0.24:8080/jsonrpc Code: { so I try to play: Code: curl -s -S -m 3 -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Play", "params": { "songid" : "0"}, "id": 1}' http://192.168.0.24:8080/jsonrpc Code: { |