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 - codex70 - 2012-12-03 Now that I can't send a keypress is there any way to activate the epg view from json? Was using: GET /xbmcCmds/xbmcHttp?command=SendKey(0xF045) which behind the scenes does: XBMC.ActivateWindowAndFocus(MyPVR, 31,0, 10,0) How would I do this from a json command, and ideally then set another command so I can return to full screen whatever is currently playing. It looks like I should be using GUI.ActivateWindow, but can't find anything more so any help would be appreciated. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-12-03 Yeah you need to call (untested) Code: { "jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window": "pvr", "parameters": [ 32, 0, 10, 0 ] }, "id": 1 } Ideally the EPG view would be its own window (AFAIK someone is working on that) so you could open it directly but that's not possible right now. To get to fullscreen call Code: { "jsonrpc": "2.0", "method": "GUI.SetFullscreen", "params": { "fullscreen": true }, "id": 1 } RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - codex70 - 2012-12-03 Thanks Montellese for such a quick response, I'm getting the following error back: {"error":{"code":-32602,"data":{"method":"GUI.ActivateWindow","stack":{"message":"array element at index 0 does not match","name":"parameters","property":{"message":"Invalid type integer received","type":"string"},"type":"array"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"} Which is king of suggesting the array elements aren't OK. Am I close here, or is this really unsupported and I'm going to have to wait till post frodo? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-12-03 (2012-12-03, 10:52)Montellese Wrote: I don't develop any client but what I don't like about this approach is that it probably results in a flickering of the keyboard being presented because it's most likely hidden when the OnInputFinished is received and then immediatelly shown again when the OnInputRequested is received. An idea would be to use this behaviour but to add an additional parameter to the notifications letting clients know whether the input is a virtual keyboard dialog (in which case the user of the client will most likely want to see the keyboard on the client as well) or not (in which case the user might not want to see the keyboard on the client as he may just be navigating around and had to go through an edit control). This is the moment I choose to discretely ask again for a new flag in Application.Property.Value to get the status RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-12-03 (2012-12-03, 16:37)codex70 Wrote: Thanks Montellese for such a quick response,Ah silly me. All the array elements in the "parameters" array must be strings so you'll have to put double-quotes around those values. (2012-12-03, 16:48)Tolriq Wrote: This is the moment I choose to discretely ask again for a new flag in Application.Property.Value to get the statusWhich status? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-12-03 To know if there's a input request occurring (I.E. if we should send key presses or keymap commands) for case when we don't get the notification. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - codex70 - 2012-12-03 That's more or less working, it's not properly using the values in the array, it's going to the last PVR view, but it's close enough and works. One last question (for now) is there any way to switch profiles with json. I've been searching and can't see anything that would work. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-12-03 I have a little problem using VideoLibrary.set., when i use this to set the playcount of a file, after that i get a error trying to get the streamdetails of this file. See the code: Quote:self.rpc("VideoLibrary.SetMovieDetails", { "movieid": movieid, "playcount": 0}, self.logReplyData);then i request the streamdetails and i get this error: Quote:> Exception caught while processing response in xbmc.rpc: TypeError: 'undefined' is not an object (evaluating 'streamdetails.video[0].aspect')After set the playcount to 0 i loose the streamdetail video for acpect ratio. Thanks for any help Clayton Well, i maked some more tests, i loose every single streamdetail, everytime i tried to get this i get a error, only happens after set the playcount; RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-12-03 Another test This is the streamdetails after i used VideoLibrary.SetMovieDetails for playcount = 0 Quote:> audio: { RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - gertjanzwartjes - 2012-12-03 (2012-12-03, 17:05)Tolriq Wrote: To know if there's a input request occurring (I.E. if we should send key presses or keymap commands) for case when we don't get the notification. But only a flag is not enough, you also want to know the current text in the control if a control or virtual keyboard is currently present. Otherwise you'll bluntly override any text that's already there, which is not very user friendly. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - gertjanzwartjes - 2012-12-03 (2012-12-03, 19:28)gertjanzwartjes Wrote:(2012-12-03, 17:05)Tolriq Wrote: To know if there's a input request occurring (I.E. if we should send key presses or keymap commands) for case when we don't get the notification. Actually Tolriq has a good point; when I think about it, what if you have opened a virtual keyboard with a simple remote, say a normal remote cotrol, or you're Apple remote, whatever one that doesn't have a keyboard. Then you grab your remote app which does have a keyboard, to edit the text in the virtual keyboard you just opened. So you connect to XBMC, and try to edit the text and all the text in there will be erased at the first call of SendText, because you didn't get an OnInputRequested because the virtual keyboard was already open. Or do you? RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-12-03 (2012-12-03, 19:26)claymic Wrote: Another test I found the problem. When i use VideoLibrary.SetMovieDetails for playcount = 0 this take at least 7 seconds for each movie, if i make any call before this time i get a error in the streamdetails. So, this is normal ? Take 7 or 12 seconds to set the playcount for each movie ? I am using the Frodo Beta 1. Thanks Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-12-03 (2012-12-03, 19:44)gertjanzwartjes Wrote:Yeah it's a valid use case but too late in the release cycle to add new methods etc. Additionally sending out an existing notifications does not affect the API so that wouldn't be such a big deal.(2012-12-03, 19:28)gertjanzwartjes Wrote:(2012-12-03, 17:05)Tolriq Wrote: To know if there's a input request occurring (I.E. if we should send key presses or keymap commands) for case when we don't get the notification. (2012-12-03, 22:29)claymic Wrote:(2012-12-03, 19:26)claymic Wrote: Another test Hm I just ran 3 VideoLibrary.SetMovieDetails calls and they were instant. I could switch to the sqlite browser, hit refresh and the changes were there. RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-12-04 Ok, i maked some more tests and will try to explain in my bad english, i am sorry for that. - Situation 1 : if i am in the window HOME (xbmc) and tried to set the playcount to 0 or 1 (using my app for ipad), take between 7 or 10 seconds and i lose all the streamdetails for the movie. - Situation 2: if i am in the window MOVIE(xbmc) and tried to set the playcount to 0 or 1 (using my app for ipad), take between 2 or 3 seconds and i dont lose the streamdetails for the movie. - Situation 3: after lose the streamdetails in situation 1, i cant get the streamdetails for this movie anymore if i am in the window HOME, but if i go to the window MOVIE and maked another request i get all the streamdetails again. I dont know if i explain right, i am sorry for that. Clayton RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-12-04 Are you playing a movie while doing this? And how are you retrieving the streamdetails? Through VideoLibrary.GetMovies or VideoLibrary.GetMovieDetails? |