Kodi Community Forum
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)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-26

The window can be opened using GUI.ActivateWindow so you can give it a try.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2012-11-26

no working, I did test with record exemple.

When I use Json( {"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"pvrrecordinginfo"},"id":1} )

I get window with recording info but nothing inside (no working also when I trying to recording in same time)


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-26

AFAIK the PVR windows are a bit special right now and will be refactored after Frodo has been released. Furthermore dialogs usually expect additional parameters/information to be able to know what information they should show.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2012-11-26

oh ok thx for quick reply Wink


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-26

Hi,
I am making a new app to work with CommandFustion in a ipad. So far everything its working great, but i have a problem trying to set a subtitle.
This works fine :
Quote:self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":"on"},self.logReplyData);
i have a function to send the json request and another function to get the log.
But i tried this:
Quote:self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":["on",0]},self.logReplyData);
to set the subtitle with index 0, i get a error.
Can someone help me to understand how to set a subtitle using the index ?
Very thanks.
Clayton


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-11-26

You don't need to set the on.

The subtitle param can be either a string with "previous", "next", "off", "on" or directly an int as the index.




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-26

Thanks Tolriq
I tried in this way too, but the problem is : if we have a subtitle in the index 0, and try to setSubitle with index 0 again, this will turn off the subtitle.
I tried to make a call to turn on the subititle with setTimeout, see :
Quote: self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":0},self.logReplyData);
setTimeout(function(){self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":"on"},self.logReplyData);}, 1000);
Dont work, the subtitle is always off. I think i will have to make another Player.GetProperties, see what subtitle index its on and put a conditional to not make the request SetSubtitle to the subtitle in use.
Very thanks for your help.
Clayton


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-26

I just make some more tests but without luck to make this work.
When i use :
Quote:{"playerid":1, "subtitle":0}
I can see in the log, the subtitle change to index 0, the subtitle is on too, but don show.
So i tried first set the subtitle to index 0 and then force a subtitle on with a setTimeout (200ms)
Quote:{"playerid":1, "subtitle":"on"}
Dont work too, the subtitle dont show.
If i have any subtitle showing in the display if i use Player.SetSubtitle the subtitle dont show anymore.
I try to make the subtitle off first, then set the subtitle to index 0 and then set subtitle on. Dont work too.
Very thanks for the help.
Clayton



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-26

(2012-11-26, 19:20)claymic Wrote: Hi,
I am making a new app to work with CommandFustion in a ipad. So far everything its working great, but i have a problem trying to set a subtitle.
This works fine :
Quote:self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":"on"},self.logReplyData);
i have a function to send the json request and another function to get the log.
But i tried this:
Quote:self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle":["on",0]},self.logReplyData);
to set the subtitle with index 0, i get a error.
Can someone help me to understand how to set a subtitle using the index ?
Very thanks.
Clayton
Try
Code:
self.rpc("Player.SetSubtitle", {"playerid":1, "subtitle": 0, "enable": true},self.logReplyData);
The "enable": true is only needed if you want to absolutely force the subtitle to be displayed. If you don't provide it and subtitles are turned off right now, it will switch subtitles but it won't display them.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-26

Thanks Montellese, i have tried this too, dont work for me.
I forgot to put a important thing, i am using Frodo Alpha 3.
The strange thing is if i use :
Quote:setTimeout(function(){self.rpc("Player.Seek", {"playerid":1,"value":"smallbackward"}, self.logReplyData);}, 200);
then the subtitle show, because that i think there is nothing i can do about.
If someone have interest in see the project i have two videos in youtube, one is showing the main project (to control the devices like tv, projector,...) the other one just show the begginer of the project for xbmc, its very diferent now, i will update the video later.
I will not post here, i think its not the right place, but i can send the video link for mp.
I will share the hole project in .js in the future and all the interface too, but CommandFusion its a comercial software,so... i dont know if will be useful for someone.
Thanks for the help
Clayton


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2012-11-26

Hum you need to know that Xbmc does prefetch a lot subtitles.

When you change subtitles thge new one won't show for a few seconds (between 4 to 10 sometimes) so perhaps your tests are ok you just don't wait enough Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - zetterlund - 2012-11-27

Hi,

I know this was asked earlier in the thread but I couldn't really find an answer to the question.

Is it somehow possible to retrieve the uPNP file path somehow via the JSON API or via a uPNP?
The PrepareFileForDownload with MovieId as parameter would be great way I think, where it returns the vfs path but also a uPNP path.

With this data it would the be possible to send the file to any DLNA renderer for playback, which, IMO, would be pretty sweet.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-27

Tuesday, November 27th 2012:
Commits: 73a9b08f264c859434b8, f00ff50ec98445ac922a
  • changed runtime from a string to an integer. It will now provide the videos duration in seconds which should make it more useful than a string with an arbitrary format.
  • added genreid, artistid and displayartist property for albums
  • added genreid, artistid, albumartistid and displayartist property for songs
  • fixed albumartist property for songs which was always an empty array



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-27

(2012-11-26, 23:31)Tolriq Wrote: Hum you need to know that Xbmc does prefetch a lot subtitles.

When you change subtitles thge new one won't show for a few seconds (between 4 to 10 sometimes) so perhaps your tests are ok you just don't wait enough Smile
Yes man, this is exactly what happens here. I just insert a setTimeout
setTimeout(function(){self.rpc("Player.Seek", {"playerid":1,"value":"smallbackward"}, self.logReplyData);}, 200);
this will force the subtitle to show.
The strange thing is if i use "next" or "previous" the subtitle show immediately.
Thanks for your help.
Clayton




RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2012-11-27

Another little question.
Since i am trying to make everything using JSON (for Eden and Frodo Alpha 3), because i will adapt the app for the new frodo later, i was thinking if is possible to make this with JSON:
- Audio and Subtitle delay
- Subtitle position change (up and down)
- Mark a video watched or unwatched
I am using the http commands for now, but if there is anyway to make this with JSON let me know guys. Very thanks for the help.
Clayton