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-26 sling100 Wrote: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.As I don't have any .m3u playlist files I never tried this myself but calling Player.Open should be able to handle playlist files (i.e. start playing them) when you provide the path to the .m3u file in the "file" property of the "item" parameter i.e. Code: { "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "/path/to/your/playlist.m3u" } }, "id": 1 } Playlist.GetItems can only be used to retrieve the items in a playlist that has already been loaded. Currently it isn't possible to load and manipulate playlist files (like m3u) but we are planning to support this in the future. jasonvp Wrote:Sorry about that, missed that one.No problem. - jasonvp - 2011-09-27 Hi guys, When using "Playlist.GetItems" to fetch "lyrics" for a song nothing is returned. Is "lyrics" only for karaoke or is it suppose to get lyrics from the lyric Add-on/scrapper (CU Lyrics)? Is this a Bug? Also "albumid" and "artistid" is not working in "Playlist.GetItems". Always returns -1 for both. Cheers Jason - Montellese - 2011-09-27 jasonvp Wrote:Hi guys,Nah that's not a bug. It only shows lyrics loaded from ID3 tags AFAIK. Imagine it would retrieve the lyrics for every song using an addon. That would take ages if you have a few songs to retrieve. jasonvp Wrote:Also "albumid" and "artistid" is not working in "Playlist.GetItems". Always returns -1 for both.That sounds like a bug. - jasonvp - 2011-09-27 Montellese Wrote:Nah that's not a bug. It only shows lyrics loaded from ID3 tags AFAIK. Imagine it would retrieve the lyrics for every song using an addon. That would take ages if you have a few songs to retrieve. You can only get the lyrics from Cu Lyrics for the current song anyway from what I can tell. Would it be possible to retrieve lyrics from the Cu Lyrics just for the currently playing song or do you think it would still take to long? Quote:That sounds like a bug. Will I create a ticket or are you onto it? Cheers Jason Player.Shuffle - aip1000 - 2011-09-27 Hi, I'm trying to use the Player.Shuffle JSON command but it's being a little hairy. I've got it to work once or twice, but right now it's not having any effect. I'm using the latest nightly build. Sorry for the ambiguity; I guess my question is, are there any known problems with the command? If not I will try to debug this some more. Here is my c# debug output: Calling JSON RPC method "Player.Shuffle"... JSON RPC call: { "jsonrpc": "2.0", "method": "Player.Shuffle", "params": { "playerid": 0 }, "id": 5 } JSON RPC response: {"id":5,"jsonrpc":"2.0","result":"OK"} EDIT: I found the PlayerControl() function online. Interestingly, using the deprecated HTTP API, PlayerControl(Random,true) Works However, in conjunction with JSON XBMC.Open(), it only worked after adding Thread.Sleep(10000) calls in between XBMC.Open and HTTP-API PlayerControl(Repeat, true) calls - Montellese - 2011-09-27 jasonvp Wrote:Would it be possible to retrieve lyrics from the Cu Lyrics just for the currently playing song or do you think it would still take to long?The native jsonrpc API provided with XBMC will never support addon specific methods because it is not guaranteed that everyone has said addon installed and we can't control which version is installed. BUT we have already discussed the plan to provide addon developers with the possibility to provide their own jsonrpc methods which can then be used by third party developers if needed. jasonvp Wrote:Will I create a ticket or are you onto it?Yes you will It's just easier to keep track of bugs/problems and makes sure I don't forget about them. Most of the time I can fix small bugs within a few hours or a day or two but sometimes I just don't have the time and if there's no ticket I'm bound to forget about it. - Montellese - 2011-09-27 aip1000 Wrote:Hi, I'm trying to use the Player.Shuffle JSON command but it's being a little hairy. I've got it to work once or twice, but right now it's not having any effect. I'm using the latest nightly build.What exactly did you try to do. Just to make sure: Calling Player.Shuffle twice will not reshuffle IIRC because that's how it works in XBMC itself. Back when I implemented the functionality I tested it on all playlist types and it worked but it's always possible to miss a (special) case. aip1000 Wrote:EDIT: I found the PlayerControl() function online. Interestingly, using the deprecated HTTP API, PlayerControl(Random,true) WorksI guess you mean Player.Open() right? There is no XBMC.Open() and you probably also mean PlayerControl(Random, true) and not PlayerControl(Repeat, true)? It might be possible that XBMC hasn't finished adding all the items to the playlist created with Player.Open() when you already try to call Player.Shuffle so the shuffle won't work but that's just a guess. - Montellese - 2011-09-28 jasonvp Wrote:Also "albumid" and "artistid" is not working in "Playlist.GetItems". Always returns -1 for both. OK I just fixed this so it should be available and working correctly in the next nightly build. - jasonvp - 2011-09-28 Montellese Wrote:OK I just fixed this so it should be available and working correctly in the next nightly build. Your the Man! Can you please give me an example for "Player.Seek" params (percentage)? It's driving me nuts. Cheers Jason - Montellese - 2011-09-28 jasonvp Wrote:Can you please give me an example for "Player.Seek" params (percentage)? It's driving me nuts. Player.Seek is the best example/usage of the newly supported "union type definition". Player.Seek takes two parameters. The "playerid" (as all the other Player methods do) and a "value" parameter. The "value" parameter can have the following values:
Hope this helps. - jasonvp - 2011-09-28 Montellese Wrote:Player.Seek is the best example/usage of the newly supported "union type definition". Player.Seek takes two parameters. The "playerid" (as all the other Player methods do) and a "value" parameter. The "value" parameter can have the following values: Thanks for your explanation. I didn't put the .0 on the end...Doh! Code: {"jsonrpc":"2.0","id":1,"method":"Player.Seek","params":{"playerid":1,"value":50.0}} Cheers Jason - Montellese - 2011-09-28 jasonvp Wrote:Thanks for your explanation. Hm it should work without tha ".0" at the end. I'll reproduce and if it doesn't work, that's a bug. EDIT: Yeah it's bugged. Sorry for that. Will fix ASAP. - jasonvp - 2011-09-29 Montellese Wrote:Hm it should work without tha ".0" at the end. I'll reproduce and if it doesn't work, that's a bug. Thanks. It's good to hear I haven't totally lost the plot yet. jasonvp Wrote:When accessing my Music Videos through "Music/Library/Music Videos" and I use "Player.GetActivePlayers" it returns " "video":true " which is correct but then if I use "VideoPlaylist.GetItems" I don't get any info returned or it returns the last played video from Video Player. I have to use "AudioPlaylist.GetItems" to get any info. This not such a big deal but there is no way to tell that I'm aware of, which Playlist Player is active. Is there a way? I finally submitted a Ticket #12016 for this. http://forum.xbmc.org/showthread.php?p=888971#post888971 Cheers Jason - Montellese - 2011-09-29 [quote=jasonvp]Thanks. It's good to hear I haven't totally lost the plot yet.[Q/UOTE] Hehe and I just fixed the bug so a "value" of 50 should now work as well. - jasonvp - 2011-09-29 jasonvp Wrote:I finally submitted a Ticket #12016 for this. Hi Montellese, Sorry about all the duplicates. |