XBMC Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)



- taoizt - 2007-11-20 14:25

This looks like an excellent interface!! Any updates on that yet? Is it also possible to used as remote software on a laptop to control XBMC?

Good good work!


- Nuka1195 - 2007-11-21 15:58

PHP Code:
import os
path 
"SMB://server/movies"
#path = "F:\\videos\\"
VIDEO_EXT ".m4v|.3gp|.nsv|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.ifo|.mov|.qt|.divx|.xvid|.bivx​|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.mpeg|.mp​4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.dvr-ms|.xsp"
print xbmc.executehttpapi"GetDirectory(%s,%s)" % ( pathVIDEO_EXT, ) ) 

Does the GetDirectory() command support samba? It works for the local path, but I can't get it to work for the samba share.

The share is available to XBMC, it works fine form all sections, it's a guest account so not an iisue there.

Thanks

Edit log output for failed response:

Quote:
09:01:08 M: 38182912 DEBUG: XBMCHTTPShim: Received command GetDirectory (SMB://server/movies;.m4v|.3gp|.nsv|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.ifo|.mov|.qt|.divx|.xvi​d|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.m​peg|.mp4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.​dvr-ms|.xsp)
09:01:08 M: 37842944 DEBUG: HttpApi Start command: GetDirectory paras: GetDirectory; SMB://server/movies;.m4v|.3gp|.nsv|.ts|.ty|.strm|.pls|.rm|.rmvb|.m3u|.ifo|.mov|.qt|.divx|.xvi​d|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.m​peg|.mp4|.mkv|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.​dvr-ms|.xsp
09:01:08 M: 37842944 DEBUG: HttpApi Finished command: getdirectory
09:01:08 M: 37855232 INFO: <li>Error



- nad - 2007-11-23 10:34

On the Xbox it should work but it currently won't on XBMC_PC.


- Nuka1195 - 2007-11-23 17:15

Ok, when i use a browse dialog to get the path, it works great, so the error is in my code above, sorry and thanks for a great feature (httpapi) Smile

Edit: so everyone else knows, it was the casing of the path. "SMB://" does not work, it needed to be "smb://". Should that be case insensitive?


- kwyshell - 2007-12-07 12:20

HTTAPI URL encoding issue:

I am trying to playback a file via HTTP API. If characters of filename are all ascii code 0-255, the api works without any problem.

If I send a file with Chinese or Japanese characters, the URL encoding function seems not to work properly.

I have tried to study the HTTPAPI control source and HTTPAPI VB6 source. I just find the URLEncode function doesn't work for UTF8 string.

After I encoding the url in UTF8 and BASE64 format, the HTTP API works.
XBMC http server can process UTF8 URL without any problem but you have to encode your URL in correct format.
Nod


- rickd - 2007-12-08 10:57

Neomorph am really interested in this capability and web interface. I am a heavy user of xbmc and girder and would love to try this out when it ready.

question will you be able to setup buttons on webpage to send an event to girder ie so we control a zones amp etc

nice work i note girder is heading to web based capability too


PPC - Client - KevMoore123 - 2007-12-08 14:47

Hi all,

Ive written a small Pocket PC Client that utilizes the XBMC HTTP- API. Its not meant to be competition for any existing clients, its just I wrote this to solve a particular problem I was having. Which was that I have an enormous library of music, and picking a particular song was a little cumbersome using the XBMC Interface.

So , I wrote a PPC client which allows me to search and build playlist. Its Beta at the mo, so there are a few features yet to be completed (Auto shutdown timer, Song on Demand (time delayed song playing), Video (although the XBMC interface is awesome for movies) and better UI design).

The app was written using c# on VS 2008 (Targeted at the CF .NET 2 framework).

You are more than welcome to have a look at the sourcecode, as its open to anyone who wants a play/interested in developing further.

Anyhoo, let me know if you want the source / client and id be happy to ship.

cheers

Kev


base64 encoding for images - KevMoore123 - 2007-12-08 14:57

Hi Guys,

are there any c# gurus help there who can help with getting a base64 image loaded into the Bitmap object via the HTTP - API? Im having a bit of hassle with the Compact Framework; Code:

public string LoadImageFromURL(string URL)
{
string xbmcCommand = string.Format(CommandConstants.FileDownload, URL.Replace("\\\\","\\"));
string fullCommand = string.Format("http://{0}{1}", _ipAddress, xbmcCommand);
MemoryStream s = XBMCHttpHandler.PostMessageWithRawResponse(fullCommand);

string tempFile = string.Format("{0}\\currentThumb.jpg", Path.GetTempPath());
using (FileStream f = new FileStream(tempFile, FileMode.Create))
{
f.Write(s.ToArray(), 0, (int)s.Length);
}

return tempFile;
}

try
{
string fileName = _helper.LoadImageFromURL(_currentlyPlaying.ThumbnailPath.Replace("\n", ""));
Bitmap bitImage = new Bitmap(fileName);
Thumbnail.Image = Image.FromHbitmap(bitImage.GetHbitmap());
}
catch (Exception e)
{
string message = e.Message.ToString();
}
finally
{
_attemptedThumbnailLoad = true;
}

The problem is that the Bitmap object wont load the filename (from the LoadIMageURL method). I try to encode it as a base64 string, but that didnt work eitherSad

Cheers

Kev


- nad - 2007-12-08 14:57

KevMoore: In case you haven't come across XBMCControl yet, have a look here: http://sourceforge.net/project/showfiles.php?group_id=87054&package_id=198866

kwyshell: I'm not too hot on how international character sets work in practice. Did you had to modify XBMCControl or was it XBMC itself? Can you tell me exactly how you got it to work (with code if possible) and I'll modify the code as necessary.


- KevMoore123 - 2007-12-08 15:21

Hi Nad,

this is my own project, not the source you have highlighted. Which of course you are welcome to if you want to play with it.

cheers

Kev