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
|
- othrayte - 2011-11-17 Blacksheep70 Wrote:A method to query if XBMC is currently idle (TRUE|FALSE) would be useful.I can see that this concept might be useful to get the current state of xbmc when you start this other thing up, but wouldn't it be better to use xbmcs jsonrpc notifications to keep a track of what state xbmc is in. - jasonvp - 2011-11-17 Montellese Wrote:Finally got around to fix this bug in https://github.com/xbmc/xbmc/commit/d187b1c2197c4477ba22f5364a3044cc1be46045 so it should now behave as you expect it to. Thanks Montellese. - dwagner - 2011-11-18 jimk72 Wrote:I was having all kinds of problems like this with tcp. also had large requests(all artist, ect..) would be sent back in random chunks. I ended up switching over to http post ect.. that way I get the full response and it is only that response and then use the tcp to monitor for notifications. Most of them are very short so a custom parser to make sure it is only one notification was easy. All my problems related to JSON ended after that I was considering this option, but was hoping it won't be necessary as I like the neatness of everything being handled in one communication stream. I'd be interested to find out if there is any performance difference between using TCP where you have to manually parse to separate objects and using HTTP where you get the full response and hence not have to do the extra parsing. Guess I'll have to run a few timing tests. As every millisecond counts when your users have big libraries. - topfs2 - 2011-11-18 dwagner Wrote:I was considering this option, but was hoping it won't be necessary as I like the neatness of everything being handled in one communication stream. http is over tcp so what you don't have to do in http is just hidden. Raw TCP is less data but http has the benefit of packaging it so that each character is not needed to be validated, you can however make that into an advantage by using stream parsing (or SAX-styled parsing). All in all I'd say they ought to be roughly the same but http being an easier starting point. - jimk72 - 2011-11-21 I had preparsing using tcp to seperate all the json requests into individual commands and then send those to the json parser. It just seemed faster to use http. I am developing using delphi for windows os so speed isnt as important as compared to reliability. Once I load all the movies or albums or artists I save all that info localy in a file called movies.lst, albums.lst ect.. the thumbs are all saved localy too so once you run it the first time it is very fast after that initial load of all avail. Currently it only updates when u refresh it. My plan is to in the background do a call for the newest 10 of each and add them to the list and also possibly do a latest additions popup or something. this would get most things in the background for me as I usually only add 2-3 movies at a time and 1-2 albums at a time. - grywnn - 2011-11-21 Hi there, i think i found a bug(?) in Files.getDirectory: When calling this with a ftp source as directory parameter, i only get subdirectories back, but no files. Steps to reproduce (i hope): - create a video source with ftp://<user>:<pass>@<host>/ as location - call Files.getDirectory, params {"directory":"ftp://<user>:<pass>@<host>/"} - Subdirectories are returned, video files are not. XBMC in file modeshows files correctly though. Tested on OS X with yesterdays nightly. Can anyone confirm this? playlist.item play - vasikgreif - 2011-11-21 Hi, I cannot figure out the correct syntax for playing an item from playlist with Playlist.Item. Anyone could post an example? What I need is to start playback from a specified item in playlist. Thanks - Montellese - 2011-11-23 grywnn Wrote:Hi there,Sounds like a bug to me. Please create a bug ticket and provide a debug log. vasikgreif Wrote:Hi, I cannot figure out the correct syntax for playing an item from playlist with Playlist.Item. Anyone could post an example? What I need is to start playback from a specified item in playlist. ThanksCan you be more specific? Do you want to use Player.Open? If so you need to execude something like Code: { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "movieid": 25 } }, "id": 1 } - Mizaki - 2011-11-24 I had someone ask this question so I thought I'd check. The input.select function doesn't bring up the menu ("m") when sent if something is playing. The "enter" key when pressed does. They were expecting the same behaviour. Should it be expected to act the same as the enter key? - vasikgreif - 2011-11-25 Hi, I'm starting specific videos from playlist with: Code: {"id":45,"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":1,"position":3}}} Thanks for help Vasik - Montellese - 2011-11-25 vasikgreif Wrote:Hi, I'm starting specific videos from playlist with: Hm I just tested it on my machine and it works perfectly fine. Here is what I did: 1. Go to TV Shows 2. Queue all episodes of a tv show (to get a video playlist) 3. Execute your jsonrpc request 4. The third episodes started in fullscreen I repeated the above procedure and changed the locations I was in XBMC GUI when I executed the jsonrpc request to see if it makes a difference whether I'm on the home screen or in the playlist view or in the episode view but the episode always started in fullscreen. Maybe you can provide more details about how you put together the playlist etc. A debug log would be helpful as well. - vasikgreif - 2011-11-26 Montellese Wrote:Hm I just tested it on my machine and it works perfectly fine. Here is what I did: Thanks for testing. I won't be at the XBMC machine till Monday to post the log, but for now, I build the playlist with: (with JS variables) Code: {"id":"+self.videoPlaylistAddID+","jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":1,"item":{"movieid":"+self.movieid[movieNum]+"}}} - Montellese - 2011-11-26 Ah now I was able to reproduce. It only happens when sending the jsonrpc request while another video is playing. Thanks for the report I'll have to find out why this happens. - Montellese - 2011-11-26 OK I found the problem but it's not an easy fix and I'm not even sure if it is a bug/problem. What you should actually do once you started playing a playlist is to use Player.GoTo to jump to another item in the same playlist. Player.Open is intended to start initial playback of an item or playlist and is not intended to be used to jump within a playlist. Because of that everytime you call Player.Open with a "playlistid" it creates the playlist from scratch which means extra work and time compared to using Player.GoTo if you "just" want to jump to another item in the existing playlist. - vasikgreif - 2011-11-27 Thanks for info, I try this tomorrow and post back, how it went. |