2016-05-02, 00:19
Hi,
I´m working on an external display for Kodi and am using JSON to query the data I need.
I want to show the remaining run time of the currently playing (mainly movies). I can query most parameters I need with e.g.:
jsonrpc?request={jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties"":["percentage","time","totaltime"]},"id":"1"
for getting the name of the currently playing movie I use:
jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "duration", "showtitle","streamdetails"], "playerid": 1 }, "id": "VideoGetItem"}
but I can´t find a parameter to get th remaining time. Obviously I could calculate the remaining time myself from "totaltime - time", but as a lazy programmer I would prefer Kodi to do the calculation for me (especially as I get hour/minute/seconds all seperate).
Is there any way to get the remaining runtime from JSON api?
And while we are at it:
I´m struggling with the api documentation right now: Is there a parameter to get current and total number of chapters?
Thanks in advance for your help - if this is documented I´d appreciate a link where I could find this ...
Thanks - Peter
I´m working on an external display for Kodi and am using JSON to query the data I need.
I want to show the remaining run time of the currently playing (mainly movies). I can query most parameters I need with e.g.:
jsonrpc?request={jsonrpc":"2.0","method":"Player.GetProperties","params":{"playerid":1,"properties"":["percentage","time","totaltime"]},"id":"1"
for getting the name of the currently playing movie I use:
jsonrpc?request={"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "duration", "showtitle","streamdetails"], "playerid": 1 }, "id": "VideoGetItem"}
but I can´t find a parameter to get th remaining time. Obviously I could calculate the remaining time myself from "totaltime - time", but as a lazy programmer I would prefer Kodi to do the calculation for me (especially as I get hour/minute/seconds all seperate).
Is there any way to get the remaining runtime from JSON api?
And while we are at it:
I´m struggling with the api documentation right now: Is there a parameter to get current and total number of chapters?
Thanks in advance for your help - if this is documented I´d appreciate a link where I could find this ...
Thanks - Peter