Kodi Community Forum

Full Version: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I agree that relying on sources.xml is not ideal but with the database design/layout (escpecially the fact that there are separate databases for different media types) XBMC currently uses it's unfeasable to check the requested path against a path in the database. Furthermore Just checking against the paths in the database would not allow you to access artwork that is stored in the filesystem alongside the actual media items because those are stored in yet another database table.

IMO copying the sources.xml file is the safest way to go.
Is Json resume by seektime still functional? I've been unable to get it working...

Code:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file": file,"options":{"resume":{"hours":0,"milliseconds":0,"minutes":41,"seconds":0}}},"id":1}

any help would be appreciated, I want to load a video file then seek to a specific time.

Only info I've been able to find suggests that resume only supports percentage of playback....
(2014-03-17, 19:26)Lunatixz Wrote: [ -> ]Is Json resume by seektime still functional? I've been unable to get it working...

Code:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file": file,"options":{"resume":{"hours":0,"milliseconds":0,"minutes":41,"seconds":0}}},"id":1}

any help would be appreciated, I want to load a video file then seek to a specific time.

Only info I've been able to find suggests that resume only supports percentage of playback....

It should work. I'll give it a try when I got some time.
(2014-03-17, 19:26)Lunatixz Wrote: [ -> ]Is Json resume by seektime still functional? I've been unable to get it working...

Code:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file": file,"options":{"resume":{"hours":0,"milliseconds":0,"minutes":41,"seconds":0}}},"id":1}

any help would be appreciated, I want to load a video file then seek to a specific time.

Only info I've been able to find suggests that resume only supports percentage of playback....

I checked the code and "resume" is not supported for "file". It only works for library items. TBH I'm not sure why, I'd have to check the rest of xbmc's player code to see if it supports resuming of non-library/arbitrary files.
I added support for that in Yatse some times ago so it does work for sure in Gotham.

I've just tested again against Beta 2 and :

03-18 10:59:37.788: V/JsonRpc(26783): JsonRpc.doRequest@241: Request : {"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"C:\\xx\\xxxx.mkv"},"options":{"resume":{"hours":1,"minutes":0,"seconds":8,"milliseconds":0}}}}
03-18 10:59:37.888: V/JsonRpc(26783): JsonRpc.doRequest@252: Response : {"id":1,"jsonrpc":"2.0","result":"OK"}

with a file not in database and queried from Files.GetDirectory and all works perfectly.
(2014-03-18, 12:05)Tolriq Wrote: [ -> ]I added support for that in Yatse some times ago so it does work for sure in Gotham.

I've just tested again against Beta 2 and :

03-18 10:59:37.788: V/JsonRpc(26783): JsonRpc.doRequest@241: Request : {"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"C:\\xx\\xxxx.mkv"},"options":{"resume":{"hours":1,"minutes":0,"seconds":8,"milliseconds":0}}}}
03-18 10:59:37.888: V/JsonRpc(26783): JsonRpc.doRequest@252: Response : {"id":1,"jsonrpc":"2.0","result":"OK"}

with a file not in database and queried from Files.GetDirectory and all works perfectly.

Yeah you're right. My glance at the code was too quick. It is however not supported for "path", "partymode", "playlist" and "channelid".

@Lunatixz: Are you using some special file that is not seekable or maybe a stack or zip or other archive or whatever?
(2014-03-18, 13:40)Montellese Wrote: [ -> ]
(2014-03-18, 12:05)Tolriq Wrote: [ -> ]I added support for that in Yatse some times ago so it does work for sure in Gotham.

I've just tested again against Beta 2 and :

03-18 10:59:37.788: V/JsonRpc(26783): JsonRpc.doRequest@241: Request : {"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"C:\\xx\\xxxx.mkv"},"options":{"resume":{"hours":1,"minutes":0,"seconds":8,"milliseconds":0}}}}
03-18 10:59:37.888: V/JsonRpc(26783): JsonRpc.doRequest@252: Response : {"id":1,"jsonrpc":"2.0","result":"OK"}

with a file not in database and queried from Files.GetDirectory and all works perfectly.

Yeah you're right. My glance at the code was too quick. It is however not supported for "path", "partymode", "playlist" and "channelid".

@Lunatixz: Are you using some special file that is not seekable or maybe a stack or zip or other archive or whatever?

My Development PC was running Frodo, Upgraded to Gotham to check if it works... Now I get no response from json only
Code:
ERROR: XFILE::CDirectory::GetDirectory - Error getting smb://......mkv
DEBUG: webserver: request received for /jsonrpc

no error, or request conformation.... Did I miss something in Gotham that needs to be changed?
System -> Settings -> Debugging -> Verbose logging... and then select verbose logging for json-rpc requests
(2014-03-18, 20:28)Millencolin007 Wrote: [ -> ]System -> Settings -> Debugging -> Verbose logging... and then select verbose logging for json-rpc requests
Thanks Smile
I experimented with the resume feature in Player.Open. In Gotham Beta 2 it works fine when I try to play a movie
Code:
{"jsonrpc":"2.0","id":3,"method":"Player.Open","params":{"item":{"movieid":1},"options":{"resume":30.0}}}

however if I try to play a song it always start from the beginning. Am I doing something wrong or is there a limitation for audio files?
Code:
{"jsonrpc":"2.0","id":3,"method":"Player.Open","params":{"item":{"songid":17065},"options":{"resume":30.0}}}
I don't think that paplayer (xbmc's music player) supports seeking.
Using Player.Seek it is possible to seek within a music file. Therefore "seeking" is possible using paplayer... but I suppose that seeking and starting playback at a fixed position is not exactly the same and may be unsupported.

In that case I will continue to use the workaround of starting playback and seeking to the proper location in the file as soon as the playback has started.
@Millencolin007'

You're calling a scraped movie, I'm trying to call the file directly. I need to load a file directly from xbmc file system ie. Smb:// and seek or resume using h:mConfused:ms. Any suggests?
I know, I was playing around with seeking independently of your problem ;-)

But as tolriq already said seeking should work with files. Here an example to play a file from a smb share
Code:
{"jsonrpc":"2.0","id":3,"method":"Player.Open","params":{"item":{"file":"smb://xbmc/Media/Movies/American Beauty/American Beauty.divx"},"options":{"resume":30.0}}}
Just be sure that your file is in a source and not a random location as access is denied if it's not the case Wink