[ALL] HTTPAPI to retrieve current status? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228) +---- Thread: [ALL] HTTPAPI to retrieve current status? (/showthread.php?tid=125631) |
[ALL] HTTPAPI to retrieve current status? - realjobe - 2012-03-15 Hi there. Using Eden RC2 at the moment on Win7 platform. Is there more structured way to ask XBMC what is the system now playing besides Code: http://ip:port/xbmcCmds/xbmcHttp?command=getcurrentlyplaying XWMM looks really good but just need to ask what the system is playing at given time.. that needs to be lite. XML-out format could be nice. EDIT: JSON RPC? http://wiki.xbmc.org/index.php?title=JSON_RPC RestClient? This is overkill for me. Have to make this happen with PHP5.x... Any help? edit: Ok, Found one PHP Rest Client https://github.com/educoder/pest and Api is http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v3 RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-03-18 For Chrome & FireFox there are great Rest Client (from Chao ZHOU). Can anyone give some pointer of how to query.. anything.. RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-03-20 Using Eden RC2. So, with POST method to http://<your-ip>::<configured port>/jsonrpc. (JSON-RPC API v4 (Eden))? In the data area comes the "payload" i.e. query, but must the Http header also be filled with ... mime? RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-03-21 Can anyone give even a small hint on how to Query with fox/chrome's Rest client something.. player status? RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-04-09 ok.. I got FireFox REST client to work..sort of.. Xbmc v11.0 REST Method = POST, Code: http://ip:port/jsonrpc Code: {"jsonrpc": "2.0", "method": "Player.GetActivePlayers", "id": 1} Code: {"id":1,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]} (DVD movie is playing) So the playerID is 1. How to ask for the name of the movie playing? RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-04-11 Well.. Code: { "jsonrpc": "2.0", "method": "Player.GetItem", "params": { "playerid": 1, "properties": ["title"] }, "id": 1 } Refering to Here RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-04-12 For PHP implementation use This RESTClient Ping is Code: $JSON = array( Dump the result into array.. Code: var_dump(json_decode($ping->getResponse(), true)); Result is Code: array(3) { ["id"]=> string(1) "1" ["jsonrpc"]=> string(3) "2.0" ["result"]=> string(4) "pong" } RE: [ALL] HTTPAPI to retrieve current status? - realjobe - 2012-04-18 I did it. I have fully functional PHP implementation to ask for current playing movie/tv-series/video. So it's doable. RE: [ALL] HTTPAPI to retrieve current status? - sirkingchase - 2012-06-19 (2012-04-18, 17:21)realjobe Wrote: I did it. I have fully functional PHP implementation to ask for current playing movie/tv-series/video. Can you post your PHP code? I am trying to do something simular, http://forum.xbmc.org/showthread.php?tid=133695 My problem right now is I have live streams that start as paused ( to buffer), if I press play if will turn off my monitor. My goal is to convert my PHP HTTP code into a json, then make it all a plugin. I need to retrieve the status of XBMC and if it is not play and my monitor is on then I dont need it to turn my monitor off. |