[LIVE] HTTP API - GetCurrentlyPlaying([thumbFilename])
#1
I'm building a module for some remotes. I've managed to receive and send all commands. I'm just really strugling with the thumbnails.

Code:
http://192.168.1.2:8080/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying(special:\\192.168.1.2\web\thumb.jpg)
doesn't seem to work.

I can't find the file on the filesystem with winscp, neither does it display when using
Code:
http://192.168.1.2:8080/thumb.jpg
or
Code:
http://192.168.1.2/thumb.jpg
with a browser.

I'm pretty sure I'm doing something wrong, I'm just getting started with linux and xbmc.
Reply
#2
Code:
http://192.168.1.2:8080/xbmcCmds/xbmcHttp?command=FileDownload(special://masterprofile/Thumbnails/Music/a/a9ae44e9.tbn)
gives another problem.

The page looks like:
9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQ

Instead of:
ÿØÿà JFIF H H ÿÛ C

edit:
This seems to be the base64 encoding, I'll have a go at decoding that first.
Reply
#3
I'd suggest you check out the jsonrpc interface. The http api is depreciated, and will be going away in the future.
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
Reply
#4
Also even if you still want to use httpapi you can use the non base64 encoded transfers added in the new webserver.

Code:
http://IP:PORT/vfs/urlencodedpath

example:

Code:
http://192.168.1.2:8080/vfs/special://masterprofile/Thumbnails/Music/a/a9ae44e9.tbn
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
#5
I already had a peak at the JSON-RPC. However I've got two problems with it:
1) I would need to use SVN version, what I'm doing is building a module which probably will be used by Custom Integrators, I highly doubt they will be willing to use SVN for customers. I'm trying to convince them to move away from Escient and others in favour of a XBMC/freenas combination. I've read that XBMC only would like them to send an email.
2) I really would need a small javascript sample how to fetch something. I build for Philips Pronto Professional remotes, they support Javascript 1.6, HTML 1.0, E4X, TCP, UDP and bitmap, jpeg and png graphics.

So I've decided to build a webserver version first, then jump to JSON-RPC when it's in the main build. Did I make a bad choice?

What I'm doing in my code:
Enable UDP broadcast with SetBroadcast(2;8278)
Start listening on port 8278 for message from a specific IP.
SetResponse format to XML (probably will change it to default later, it's easier for now)
GetCurrentlyPlaying
Then I calculate the time the currentlyplaying (if any) has started and keep updating the difference between that and current time on screen until an event is broadcasted.
The rest of the buttons on screen use ExecBuiltIn(ActivateWindow()) and Sendkey()

Once this part is running I'll have a go with the music/video playlists and libraries on the remote.
The current interface has a carbon look, just like my Denon module http://www.remotecentral.com/cgi-bin/mbo...d.cgi?1858, but the final will probably look a lot like confluence.
Reply
#6
The entire webinterface is built with jsonrpc in the svn release, with js so consider it a sample.

And its your choice which way you want to go, httpapi will be around for a while so you'll have time to redo when your ready Smile

JSONRPC is subject to change right now so what works in one revision might not in another, trying to get a good API right now 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
#7
The none base64 link is only in the SVN version?
That webinterface is a great hint, I'll have a peak at it.
I've also had a go with uPnp, but it looks as if xbmc doesn't respond to SSDP M-SEARCH requests, so there is no way for me to find the correct port.

And before I forget: topfs2, you're the man. I deeply respect the amount of time you're taking to help people on the forum and build on the webserver/RPC parts.
Reply
#8
I've managed to decode base64 on the remote, however it's really slow (9 sec per thumb), so I've updated to SVN, and use the vfs. Now it's 1-2 sec per thumb when doing one including screen update, so it will probably be less then 2 sec when fetching 6 and update the screen (which I'll be doing later when I start on the libraries).
So now that I've decided to use SVN I might aswell jump to JSON. Could someone provide a link to the webserver in the SVN source?
Reply
#9
should be in trunk/xbmc/web/poc_jsonrpc IIRC
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
#10
sWORDs,

The command you want is:

http://192.168.1.2:8080/xbmcCmds/xbmcHtt...\thumb.jpg)

(special:\\xbmc is a pointer to the xbmc installation folder not to the xbmc machine.)

Reply
#11
Doesn't work. I've started with that command and just tried it again with 29315, but the thumb doesn't get created. I've just checked the permission and only owner has write access to that folder. However I get a permission denied when changing permissions from winscp.
Reply
#12
yes, xbmc does need write permission to that folder.

Reply
#13
After
Code:
sudo chmod 777 /usr/share/xbmc/web
it surely works. Tnx! Now I can start with the webserver and move to JSON later. I'm really happy!
Reply

Logout Mark Read Team Forum Stats Members Help
[LIVE] HTTP API - GetCurrentlyPlaying([thumbFilename])0