JSON RPC Player State? - 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 Player State? (/showthread.php?tid=127077) |
JSON RPC Player State? - UndisclosedP - 2012-03-29 Hi All, Finally got around to updating to Eden and have a play with the new JSON RPC stuff. I've had a read through Montellese's very useful thread on the changes made and note the following. Quote:Replaced Player.State, Player.GetTime and Player.GetPercentage with Player.GetProperties But making a JSON RPC request to Player.GetProperties with State properties returns an error message. Request: Code: "{\r\n \"jsonrpc\": \"2.0\",\r\n \"method\": \"Player.GetProperties\",\r\n \"params\": {\r\n \"properties\": [\r\n \"state\"\r\n ],\r\n \"playerid\": 1\r\n },\r\n \"id\": 1\r\n}" Response Code: { So, is there anywhere now I can find out the state of the player (Paused/Playing) Thanks RE: JSON RPC Player State? - Montellese - 2012-03-29 What makes you think that there is a "state" property? Before that change Player.State returned things like playing, paused etc so these had to be integrated into Player.GetProperty. The wiki page on the JSON-RPC API is pretty complete so looking at JSON-RPC_API/v4#Player.Property.Name (wiki) shows you a list of available properties and "state" is not among them. To determine whether a player is playing or paused you can use the "speed" property. If it equals 0 the player is paused otherwise it's playing (maybe rewinding or fast-forwarding depending on the value). RE: JSON RPC Player State? - UndisclosedP - 2012-03-29 Ahah, thank you Montellese. I just assumed that since GetProperties took percentage and time as properties it might also take state based on your other comments in that thread I did wonder if state was missed out of the API docs, and I couldn't see an obvious other place to get player paused/playing so thank you again for pointing me in the right direction. Much Appreciated! |