![]() |
|
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- XBMC Community Forum (http://forum.xbmc.org) +-- Forum: Development (/forumdisplay.php?fid=32) +--- Forum: Development (/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (/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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
- el_Paraguayo - 2011-12-02 17:45 Great. I learn something new every day. Sorry if these are really basic questions for you! Notifications for slideshows - dwagner - 2011-12-04 18:13 Is there any notification for when a slideshow or pictures are shown? Having this would be useful as I was prefer not to continually poll the server for when a slideshow or picture are played. Currently I use the Player.OnPlay and Player.OnStop notification to update data on what is currently playing. - Montellese - 2011-12-04 18:27 dwagner Wrote:Is there any notification for when a slideshow or pictures are shown? Currently not. The whole slideshow stuff is very badly integrated into XBMC and requires a lot of extra work for it to be available in JSON-RPC at all. - dwagner - 2011-12-04 18:44 Montellese Wrote:Currently not. The whole slideshow stuff is very badly integrated into XBMC and requires a lot of extra work for it to be available in JSON-RPC at all. That's quite sad, because I do see that Player.GetActivePlayers correctly retrieves the picture player. I was using the notification system to just get info when it changed, but without getting the picture information the notification system goes out the door for me and I instead have to continually poll to see if pictures are being shown as opposed to videos and music. - dwagner - 2011-12-04 23:57 Hi Montellese, One other thing I've noted as I am trying to do my work arounds for pictures. The JSON result for Player.GetItem comes back with correct picture information for file, label and type but it gives me a path to a fanart image that supposedly sits in the Video/Fanart directory. The file does not exist there. Another issue seems to be that if you view a single image, the return has the correct thumbnail, but if you view images in a slideshow the return has no thumbnail set. - wuench - 2011-12-06 18:25 Trying to convert my code over to Pre-Eden. When I try to submit the following command: {"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","params":["System.CurrentControl"],"id":1} I get back an error: {"error":{"code":-32602,"data":{"method":"XBMC.GetInfoLabels","stack":{"message":"Invalid type string received","name":"labels","type":"array"}},"message":"Invalid params."},"id":1,"jsonrpc":"2.0"} I can't make heads or tails out what this is trying to tell me. Is it saying the info label "System.CurrentControl" is not supported. If not, is there a list of which infolabels are supported? I get that infolabels are deperecated, but I am more trying to figure out how to read the new docs and what array [1...x] means and the JSON schema stuff. Debugging my code, one command at a time. Some examples in the docs would be really helpful. - Montellese - 2011-12-06 18:49 The most important thing the doc tells you is that XBMC.GetInfoLabels takes a parameter named "labels" (http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v3#XBMC.GetInfoLabels) which is not present in your request. So you're request should look like this: Code: {"jsonrpc":"2.0","method":"XBMC.GetInfoLabels","pa rams":{ "labels": ["System.CurrentControl"] },"id":1}The reason why the error message tells you that it received a string but expected an array is because it thinks you are using JSON-RPC's by position notation i.e. the parameters are not provided by their names (in this case e.g. "labels") but by their position (i.e. "params" is an array and not an object) and so XBMC thinks that "System.CurrentControl" is your first parameter. Taking a look at both the JSON-RPC 2.0 specification and the JSON schema draft help a lot in understanding the docs. BTW [1..x] means that the array must contain at least 1 item but can contain as many items as you want. Alternatives would be [] which means the array can take 0 to infinite items or [0..5] which means the array can take 0 to 5 items and so on. - wuench - 2011-12-06 21:26 Yep, that worked. Thanks. I read those docs, but it's just not quite sinking in yet... So there may be more dumb questions coming...
Slideshow - vasikgreif - 2011-12-09 12:42 Hi, how are picture playlists supposed to work?Do they have it's own id and how can I start slideshow? I tried adding the picture as: Code: {"id":50,"jsonrpc":"2.0","method":"Playlist.Add","params":{"playlistid":1,"item":{"file":"smb://192.168.1.109/filestore/1.jpg"}}}Thanks Vasik - Montellese - 2011-12-09 12:50 You can either use Player.Open and pass a path to a directory with pictures in the "path" property of the "item" parameter (And optionaly specify "random" and "recursive" as well) or you can add pictures with Playlist.Add to the playlist with ID 3 (this is how it is right now but might change in the future but Playlist.GetPlaylists will tell you the available playlists, their type and ID) and then use Player.Open and pass the "playlistid" 3 in the "item" parameter. |