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
|
- Bram77 - 2010-04-14 that would be a nice test case - Bram77 - 2010-04-14 Is there a logic behind the order in which the GetActivePlayers method returns the values? I mean, can I assume the last value is the player most recently used or started? I'm merging the VideoPlayer, AudioPlayer and PicturePlayer namespaces into one namespace because of the overlap. This makes it less work to maintain the code. So I use the GetActivePlayer method to determine the default player if no specific player has been specified. I'd like to know which player I should assume to be the one most recently addressed. - topfs2 - 2010-04-14 Bram77 Wrote:Is there a logic behind the order in which the GetActivePlayers method returns the values? I mean, can I assume the last value is the player most recently used or started? The logic of the order is that we first check if we are playing video or music, if so we add audio / video player. Then we check if we are playing pictures and thus add it. I'm open for better suggestions here since the first item actually can be any then, its only if there are 2 items we know first must be video / audio and second is picture. - Bram77 - 2010-04-14 To keep it simple, maybe you could add a method that returns the most recently addressed player? ActivePlayer or so...? - Bram77 - 2010-04-14 The SeekTime seems to use seconds, not in MS as described in introspect. - Bram77 - 2010-04-14 I'll just keep posting unexpected behavior This... Code: {"jsonrpc": "2.0", "method": "PicturePlayer.Zoom", "params": 150, "id": 1} ...returns an error.... Code: "code" : -32602, "message" : "Invalid params." ...no matter what integer value I pass. The introspect describes the method expects a integer value. Am I missing something? - Bram77 - 2010-04-14 There is no option to choose between right or left rotation in the XBMC PicturePlayer (not as much in the JSON api), is there? - topfs2 - 2010-04-14 Bram77 Wrote:To keep it simple, maybe you could add a method that returns the most recently addressed player? ActivePlayer or so...? IMO, more confusing for multiple clients. Perhaps return { "audioplayer": true, "videoplayer": false, "pictureplayer": true } is easier to use. Bram77 Wrote:The SeekTime seems to use seconds, not in MS as described in introspect. Hmm, might be, cooked it up rather fast Bram77 Wrote:I'll just keep posting unexpected behavior integer needs to be between 1 and 9, but this isn't self explaining, a float would be more appropriate for this perhaps. Bram77 Wrote:There is no option to choose between right or left rotation in the XBMC PicturePlayer (not as much in the JSON api), is there? Nope, not sure it exist in core either, although I like the idea. Please a ticket for it (not jsonrpc related). - Bram77 - 2010-04-14 The boolean responses for active/inactive players does seem more efficient as checking for the states does takes less code and they can only have two states. The video- and music player can't ever be playing at the same time and the picture player will always be the most recently addressed if music or video is playing. Is that correct? If so, there is no need for a function that returns the most recently addressed player. Some more questions.... - System.GetInfo returns a valid JSON response with the value 'null'. This method hasn't been completed yet in the api, or is it a bug? - Files.GetSources seems to expect a parameter but I can't figure out what it should be. - Bram77 - 2010-04-15 ... and some suggestions for additional methods ... - VideoPlayer.TogglePartyMode - AudioPlayer.TogglePartyMode - Status.GetRepeatMode - Status.IsPartyModeEnabled - Status.IsPlaying - Status.IsMuteEnabled - Status.IsVideoShuffleEnabled - Status.IsAudioShuffleEnabled - Status.IsLastFmEnabled - Status.GetNowPlaying - Status.GetNowPlayingTime - Status.GetNowPlayingTimeMS - Status.GetNowPlayingPercentage - Status.GetNowPlayingAudio - Status.GetNowPlayingVideo - Status.GetVolume - AudioPlayer.LastFmLove - AudioPlayer.LastFmHate - Controls.ToggleMute (move from the XBMC namespace) - Controls.Stop (regardless of what type of media is playing) - Controls.PlayPause (play/pause the currently playing media; regardless of the type of media) - Controls.Play (start playing the current playlist; regardless of the type of media) - Controls.SkipNext (next in playlist; regardless of the type of media) - Controls.SkipPrevious (previous in playlist; regardless of the type of media) - Controls.Forward (regardless of the type of media) - Controls.Rewind (regardless of the type of media) - Controls.SmallSkipBackward (regardless of the type of media) - Controls.SmallSkipForward (regardless of the type of media) - Controls.BigSkipBackward (regardless of the type of media) - Controls.BigSkipForward (regardless of the type of media) - Controls.SendKey (could make life a lot easier for anyone using a HTPC/Xbox without a keyboard attached) ... most of the controls overlap with the existing controls. But they could make using the api a bit easier. I've already got it covered in the JS api. Making it easier to use will hopefully move more people to developing remotes The status requests were a real b*tch in the HTTP api. They rendered a lot of overhead since I could only get the total sum of now playing. Having to obtain all the data to get the current playing percentage and filename (which are refreshed every second by default in XbmControl i.e.) made it hardly impossible to not get timeouts and lockups. So allowing to access this data individually could greatly improve speed and ease of use. Essentially 4 values are required every few seconds/second in most cases.... - Current volume - Current playing time/timeMS/percentage - Some way to detect if new media is playing so all the other data can be updated (now playing info; artwork; highlighted playlist item; I use the file path for this in XbmControl since it's unique) - Is anything playing at all? (slow down the request interval to reduce network load if not; the previous value could potentially be used for this) ... Ideally these values could be requested with ONE post. Maybe the "XBMC.StartSildeshow" method should be in the PicturePlayer namespace? Great to be able to post suggestions, even though I'm not expecting them to be implemented all...or any of them I'm just suggesting. - sebak - 2010-04-15 Nice stuff bram77. Would like to help on the web interface. Maybe some people can gather for this. I started a topic about this some time ago, but it seems to have disappeared with the forum downtime. - Tolriq - 2010-04-15 Quote:Essentially 4 values are required every few seconds/second in most cases.... I would just add the playing / paused status in this every second request since there can be multiple way to control XBMC we need to have this info to update buttons accordingly Too bad there was a one month forum lost lot's of things where said about new functions. Another needed one is the system.getinfo to get os / version and logged user at minima And the seekPercent :p:p - Bram77 - 2010-04-15 sebak Wrote:Nice stuff bram77. Great idea. I have some visions of how it should function and where every should be, but I'n not a graphical designer. So maybe I'll just try to write a easily themable basic interface with all the functionalities and everyone with some graphical and HTML/CSS skills can have a go at beautifying it. - Bram77 - 2010-04-15 Tolriq Wrote:I would just add the playing / paused status in this every second request since there can be multiple way to control XBMC we need to have this info to update buttons accordingly With playing time/tmeMS/percentage I meant seekTime, seekTimeMS and seekPercentage. You're right, I forgot about play/pause, that would be nice to! - Bram77 - 2010-04-16 When playing a streamed media file the GetPercentage method returns inf which is not a string. The JSON parser crashes on this value. I could try to work around it, but I guess 0.0 would be valid value to? I don't really like to work around stuff edit: What would be cool is a method that returns more details about the media played, like the codec used, the resolution, audio quality (bitrate), frequency, and if it's a stream or just a file i.e. There's no way to detect this these values reliably now. |