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
|
- Montellese - 2011-09-23 grywnn Wrote:I can open tickets for these two things if needed. Please do that. Thanks. - mzanetti - 2011-09-23 Montellese Wrote:Well it doesn't work in the sense that it will add all items from album 1 AND from artist 1. It will only add items from album 1 because the second "item" overwrites the first one. Ok... got it... Actually this all makes sense... It's just that I had everything in place with the old API and I got used to how it was working there... The new API behaves quite different then and confused me. Anyways, thanks for the clarifications. - Montellese - 2011-09-23 Yeah the new API is quite a dramatic change but we thought that now is the only chance we'll ever get to make such a change because we already dropped backwards compatibility to Dharma with all the other changes in jsonrpc. So we took the chance to create a clean API on which we can build in the future. I know that JSON schema is not always easy to understand (apart from the obvious properties like "minimum" and "maximum"). It took me a while as well to get my head around the "union type definitions" as it is not very well described in the JSON schema specification and I had to study quite a few examples until I grasped the meaning and usage of it. So feel free to ask if you are not sure instead of trying for hours and not getting it to work. - jasonvp - 2011-09-24 Hi guys, Player.GetProperties/Player.Property.Name which replaced Player.State has no "playing" or "paused" option. Are these going to be added? Cheers Jason - Montellese - 2011-09-24 jasonvp Wrote:Hi guys, We thought that having "playing" and "paused" was kindof overkill and then we decided that we use the "speed" property to determine whether a player is currently playing (speed != 0) or is paused (speed = 0). - jasonvp - 2011-09-24 Montellese Wrote:We thought that having "playing" and "paused" was kindof overkill and then we decided that we use the "speed" property to determine whether a player is currently playing (speed != 0) or is paused (speed = 0). Fair enough. I didn't pick up on that. Cheers Jason - mzanetti - 2011-09-24 Calling this crashes xbmc: Code: "{ "id" : 22, "jsonrpc" : "2.0", "method" : "Playlist.Clear", "params" : { "playlistid" : 2 } }" This can be worked around by calling Player.Stop before the Playlist.Clear but still shouldn't happen I guess. - jasonvp - 2011-09-25 Hi guys, What am I doing wrong? Code: {"jsonrpc":"2.0","id":1,"method":"Player.SetSpeed","params":{"playerid":0,"speed":2}} Code: {"error":{"code":-32602,"data":{"method":"Player.SetSpeed","stack":{"message":"Received value does not match any of the union type definitions","name":"speed","type":["string","integer"]}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"} Cheers Jason - Montellese - 2011-09-25 mzanetti Wrote:Calling this crashes xbmc:Thanks for the report. I thought I had tried all those cases but seems like I didn't do it right. Could you please create a bug report on Trac so I don't forget? jasonvp Wrote:Hi guys, Broken here as well. Probably a bug in my union type implementation. Please create a bug ticket as well. Thanks. - jasonvp - 2011-09-25 Montellese Wrote:Broken here as well. Probably a bug in my union type implementation. Please create a bug ticket as well. Thanks. Thanks Montellese. Just to add, "increment" and "decrement" work but I'm just wondering what the speed values i.e. 2, 4, 8, 16 are suppose to represent? e.g. I would have thought that "speed":2 would mean twice as fast as "speed":1 i.e. a song that is 4 minutes long would take 2 minutes to fast forward to the end. It currently only takes 4 seconds at "speed":2 using "increment" sent once. Seems to fast to me. Cheers Jason - Montellese - 2011-09-25 jasonvp Wrote:Just to add, "increment" and "decrement" work but I'm just wondering what the speed values i.e. 2, 4, 8, 16 are suppose to represent? Yeah it was a bug in my union type implementation. I fixed it and Player.SetSpeed should now also work with the numerical values (btw I also added -32 and 32). You are right, setting the playback speed to 2 on a playing song plays it way faster than 2 times the original speed. But when I use the Fast Forward functionality from the music player OSD in XBMC itself that's the way it works there as well. So jsonrpc simply works the way it works when using the GUI functionality. But I agree that it's not very intuitive. - sling100 - 2011-09-25 Forgive me for the stupid question, but can someone explain to me how I load a .m3u list via JSON? I assume I use a Playlist.GetItems, I'm just not sure of the syntax for using a filename rather than a numerical ID. Thanks Simon - jasonvp - 2011-09-26 Quote:Montellese;896673]Yeah it was a bug in my union type implementation. I fixed it and Player.SetSpeed should now also work with the numerical values (btw I also added -32 and 32). Thank you. Quote:You are right, setting the playback speed to 2 on a playing song plays it way faster than 2 times the original speed. But when I use the Fast Forward functionality from the music player OSD in XBMC itself that's the way it works there as well. So jsonrpc simply works the way it works when using the GUI functionality. But I agree that it's not very intuitive. I did some more investigating and found that in the Video Player Fast Forward x2, x4 etc. work as you expect but Rewind speed is faster than expected. The Music Player is way out for both Fast Forward and Rewind...weird. I'll submit a Bug Ticket. I also noticed that "fields" for "Playlist.GetItems" is not working with Windows GIT:20110924-0074b5e. It was working fine with GIT:20110919-8af9b11. Result Code: {"code":-32602,"data":{"message":"Too many parameters","method":"Playlist.GetItems","stack":{"name":"playlistid","type":"integer"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"} Cheers Jason - Montellese - 2011-09-26 jasonvp Wrote:I did some more investigating and found that in the Video Player Fast Forward x2, x4 etc. work as you expect but Rewind speed is faster than expected. The Music Player is way out for both Fast Forward and Rewind...weird. I'll submit a Bug Ticket. Yeah certainly someone (who implemented that functionality in the different players) knows about this better than I do. jasonvp Wrote:I also noticed that "fields" for "Playlist.GetItems" is not working with Windows GIT:20110924-0074b5e. It was working fine with GIT:20110919-8af9b11. Probably because all "fields" parameters have been renamed to "properties" on 20th September (http://forum.xbmc.org/showpost.php?p=893214&postcount=1225) - jasonvp - 2011-09-26 Montellese Wrote:Probably because all "fields" parameters have been renamed to "properties" on 20th September (http://forum.xbmc.org/showpost.php?p=893214&postcount=1225) Sorry about that, missed that one. Cheers Jason |