• 1
  • 25
  • 26
  • 27(current)
  • 28
  • 29
  • 226
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
erhnam Wrote:Yeah sorry. I'm not very used at the quote and edit buttons since my status has changed. Sorry for that.

I started building my xbmc php remote app just a couple of days and using only POST.

Hehe, np. I was first thinking my account got stolen or something Smile

So then it makes perfect sense to have post aswell, and its backported to dharma now even!


sWORDs Wrote:
  1. Do you mean "XBMC Community Forum->Development->XBMC Feature Suggestions" or "TRAC Feature Request"? Compacted JSON means less data to send and lighter parsing for clients.
  2. Maybe I could write some JSON and EventServer documentation?
  3. And are there any control methods that I don't know off? (Besides the ones in the list above?)
  4. There is another odd thing. With Camelot [LIVE] keypresses were send using f100 + ascii code. With Dharma [WINDOWS] f100 + ascii doesn't work, f000 + ascii does? (With EventServer and HTTPAPI sendkey)

Once again, every comment I make isn't ment to bash your work in any way, I just would like to improve an already great feature and it's documentation.

1. Meant trac actually, and yeah I agree that sending less data is a good thing. Perhaps default to the less data and have an advanced setting for the non-light for easy development.
2. More than welcomed to write up documentation, always helpful if someone does that. My time is rather limited but I'd be glad to clear things out if need be.
3. Not that I know of.
4. Hmm, well that keyboard code is insane atm, its incredibly hard to follow and in serious need of redesign. TBH I don't even begin to know how to fix that but please provide a trac ticket for it at any rate.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
hey topsfs2, what's the best way to get progress information on a remote client I am building for WP7? As of now, the only way I can think of is sending an HTTP request every second (which is sad) Sad

Also, I actually want to get more than just progress, like what player is active, currently playing media etc. Are you planning to add some commadn to club what the client wants?

Lastly, I didn't see an api to get information about a particular movie based on movieid or song based on songid etc. The VideoLibrary.GetMovies passing movieid as param doesn't work and it return the whole list. How can I ask it to filter based onthe movieid I sent?

thanks
Reply
There is no way besides polling, and even if we sent announcements about the progress, it would make no sense to send them every time a second passes. We announce when xbmc player skip, pause or stop. This along with your initial progress getter should be enough to render progression without polling every second (your client has a clock, use it Tongue)

Most of the others you as for exist, check the introspect. As for getting info about a single movie, if its playing it should exist in the FooPlaylist, if its not I don't see the point of asking for a single movie since what you want is probably get the ones that are available.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
Actually what I do is a bit different, I use the time elapsed to calculate the time the song has started and use a timediff on that to display progress and time. I keep doing that until an announcement (or UDP broadcast) comes in:
Code:
self = this;
[...]
else if (b[i].substring(0, 5) == "Time:") {
                    self.CurrentlyPlaying.Time = b[i].substring(5);
                    self.CurrentlyPlaying.Started = new Date() - (parseInt(self.CurrentlyPlaying.Time.substring(3, 5), 10) * 1000 + parseInt(self.CurrentlyPlaying.Time.substring(0, 2), 10) * 60000);
                    self.UpdateTime();
                }

[...]
    this.UpdateTime = function(){
        if (self.CurrentlyPlaying.PlayStatus == "Playing") {
            Now = new Date();
            if (Now - self.LastPoll >= 980) {
                self.Widgets.B8.label = time(Now - self.CurrentlyPlaying.Started);
                self.LastPoll = Now;
                Activity.scheduleAfter(980, self.UpdateTime);
            }
        }
        else {
            self.Widgets.B8.label = "";
        }
    };
So this way I only poll when something has actually changed, while the progress and time get update on the remote every second.

edit:
I need to refresh before posting or read better. It's what topfs2 said.
Reply
Thanks guys. How does annoucnements work and how can I register for these announcements? I believe I am just not aware of it. I am currently using JSON over http.

Regarding the use of asking for single movie information, I show a list of movies to the user and when user click on a particular movie, I navigate to a seperate page with the rich Movie object. Lot of times, you don't want dependency between pages and in those case, once can just pass movieId as query parameters and the other page can just get the movie information.

There could also be scenarios where once may want to save the movieid, songid etc and just want to get information based on that.

I believe having that flexibility would be useful. The api allow start and stop as param, can we add id as well that way it would just filter for that particualar type of media?

thanks,
Reply
I read a little but more so it seems XMBC broadcast UDP packets and I am assuming that;s how the annoucement would come to the clinet. Is it correct?

If that's the case, i don't think Ihave much options as WP7 doesn't have support for TCP/UDP conenctions Sad
Reply
JSONRPC does not transmit the announcement over UDP, it does over TCP (port 9090). There is no standardize way to announce over http, comet is a thing that is meant to adress that but I have tbh no clue how that work but would gladly accept patches for it Smile

And for WP7, if it can connect to http it should be able to connect to TCP (http is over TCP). And I would bet my life that its able to connect to raw sockets like UDP/TCP, otherwise its a complete fail (phone that is) Smile
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
hello_man, you can do exactly what you're asking RE getting a single movie. It's not done with the movieid though Wink Look a little closer at the sort params.

And topfs2 - WP7 has no socket support Sad but it's easy enough to work around with (smart) polling.
XBMC Remote7 an XBMC library browser/remote for Windows Phone 7.
Xbmc-Json a .NET XBMC JSON API Library.
Xbmc-Remote-Control a .NET based XBMC library browser and remote for Windows, Linux and OS X.
Reply
Quote:Sep 03, 2010 at 4:17 PM
sockets support has not been announced/committed. It is a very common ask, so I am sure it will be prioritized highly.. Unfortunately we are just getting done with the current release and have not completed planning for the next releases, so nothing to announce at this point..
Fail

topfs2, compacted json request->http://trac.xbmc.org/ticket/10495
Reply
topfs2 Wrote:As for getting info about a single movie, if its playing it should exist in the FooPlaylist, [...]
But you can clear the playlist while a movie/song is playing. Then you are not able to get the information about the currently playing file.
:eek2: AWX - Ajax based Webinterface for XBMC (Dharma Beta 2)
Reply
And bugs that sometimes does make the function to not return all data too Smile
Reply
Hmm, I didn't think of your scenario MKay. And Tolriq yeah that one is really annoying Smile

I guess we might need a method in the player then to return currently playing info, hoped we could live without it but seems like not so much Smile Although the whole Audio / Video Playlist stuff needs to go when the cores playlists management is better (I envision something like the player have an active playlist which the items are gotten just like any virtual playlist, in that case removing a playing item probably would make it skip Smile ).
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
dstruktiv Wrote:hello_man, you can do exactly what you're asking RE getting a single movie. It's not done with the movieid though Wink Look a little closer at the sort params.
.

dstruktiv, where you see the information about these apis? I only know of http://wiki.xbmc.org/index.php?title=JSO....GetMovies which doesn't tell much Sad
Reply
Ive been struggling for days trying to figure out how to use this:p I'm such a noob when it comes to json (Never even heard of it until a few days ago)

Im trying to code a web interface for XBMC because i find that all of the interfaces atm are lacking some things in different areas. Plus i like coding my own tools Smile

So anyway is there anything to help with this at all? i simply do not understand the syntax:S Any tutorials? i know there are lists of commands, but how do i set out the json query and post it? im trying things along the lines of...

Quote:jQuery.post("http://127.0.0.1:8080/jsonrpc" + '?GetMovies', '{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "start": 0, "fields": ["title"] }, "id": 1}', jQuery.proxy(function(data) {
alert(data);
}, this), 'json');

To try and get a list of films... the alert just returns NULL i simply dont understand it. Any help would be appreciated. Thanks
Reply
You are supposed to post a json object, not post a url parameter as a json object. There should be plenty of information about how to access jsonrpc (not specific to xbmc) from jquery I would imagine.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
  • 1
  • 25
  • 26
  • 27(current)
  • 28
  • 29
  • 226

Logout Mark Read Team Forum Stats Members Help
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC8