Kodi Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - 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)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38


- kraqh3d - 2005-12-30

i honestly see no point for my files. sorry. i dont consider it a media location. it's merely there for better dashboard functionality. it's not like you're going to be copying a file from the http api.

** edit **
i'll add it anyway for completeness to both getshares and getmedialocation commands.






- TeknoJuce - 2006-01-01

awesome!  great work werks great!
ex: ( /xbmccmds/xbmchttp?command=getmedialocation&parameter=files;smb://compname;pathsonly )
love it! you tha man kraqh3d.






- Drongo - 2006-01-05

nad, having trouble with your getthumbfilename command. i am passing the album & filename parameters that i get from the getcurrentlyplaying command and the thumb returned is:-

q:\album\thumb\filename.tbn

i assume q is a virual drive with its root where xbmc resides. there are no tbn files in this folder and the filename returned does not appear to exist anywhere. however there is a temp sub folder where the cached tbn images are stored and i was expecting it to return a file from this location. the cached files here all seem to be the tbn files that have been looked up on the cddb database, so why am i having problems.


- kraqh3d - 2006-01-05

i can check this out in a day or two, unless nad gets to it first.


- nad - 2006-01-08

hi all - i'm back.

great to see all the activity on this thread over christmas and the new year.

in response to a couple of queries that came up when i was away:

getthumbfilename returns the filename that xbmc uses or would use for the media's thumbnail with the given parameters; it does not indicate whether the thumbnail exists or not. if it does not exist then you can either get xbmc to download it through the regular xbmc gui or you can use the api's filedownloadfrominternet command.

the playmedia command tests for the file's existence because if it does not exist then xbmc's internal playmedia command seems to crash if the file does not exist. as discovered this causes problems for urls pointing to remote media. as a quick fix i'll take out this existence test.


- Drongo - 2006-01-08

nad, sorry if its a stupid question i'm a little confused with the thumbnail problem. are you saying that the thumbs are actaully downloaded from a remote server or do they reside on the xbox 'f' drive. if the latter then i can't find them. i was assuming because the normal tv screen gui displays the correct thumbnails and those thumbnails reside in 'e:/apps/xbmc/album/thumb/temp', then your api call would return the same temporary tbn filename.


- kraqh3d - 2006-01-08

nad,

the "getthumbfilename" command needs to work differently dependant on the media type of the passed parameter.

if the parameter is a music file or folder, you need to make a pitem, set the thumb with pitem->setmusicthumb(), and then return the set thumb with pitem->getthumbnailimage().

for video pitem->setthumb() should be applied first, and then you need to somehow call the guiwindowvideobase:Confusedetimdbthumbs() to check for cached imdb thumbnails. (i'd have to look at the code, but i dont think this is possible today because its probably not a public function. it'll likely need a wrapper around it which will accept an arbitrary cfileitemlist.)

this is why i have a problem with most of the http api. the commands need to be scoped based on the media window type. i think this is because it was originally developed with just music in mind, but has expanded beyond it.






- nad - 2006-01-08

i have fixed playfile (not playmedia as i put in my last message) so that it checks for remote media and if detected immediately plays it without checking for existence, non-remote media is still checked for existence. if this still does not work please let me have examples of url which fail.

kraqh3d:you are correct on both counts in particular it was originally developed for local audio media. any help you can give in generalising the api would be appreciated.


- jmarshall - 2006-01-08

this is mostly offtopic, but here goes:

for the thumbs stuff, why not put it in the cfileitem class with setvideothumb() as the function?

also, one thing we may wish to look into is whether or not it makes sense to have a separate cfileitem for different types (ie cmusicfileitem and cvideofileitem) to clean some of this sort of code up. nothing other than music needs the tag info for instance, and we generally know immediately what type of file it is when we create the fileitem object. there is similar stuff that is video-only and other stuff that is xbe-only.

nad: what can i do to induce the crash in playmedia() that you speak of so i can look into fixing it?

cheers,
jonathan


- kraqh3d - 2006-01-09

that sounds like a promising idea. there could be a cfileitem subclass for each media type. then there could be virtual set* functions for each type (setthumb() for icons, settag() for various pieces of meta data, etc.)


- Livin - 2006-01-09

(donno @ dec. 23 2005,06:28 Wrote:good job nad on the httpapi.:bowdown:
loved the xbmc control desktop application.  :kickass:
i spend the last two days adding to the code from 1.22 from sf.
it has been auto updated to visual basic 2005 .net
so if it doesn't run at all might need to grab .net framework 2

features/redos
- add the infomation panel (shows freespace, temp and few other bits and pieces
- redid the media tab - made alt method of showing bookmarks

fixes
- if not listening to anything it would msn would still have ' - '
- when playing video it shows as xbox video: filename - video (mainly coz i when i trying never got 'tags')

soon (after x-mas hopefully)
- control tab be finshed - so have more ff/rw
- my files -- a way of copying files (using 2 tree views).

not include is the pocketpc.
links:
pc biniary: biniary link here
source: source code here  

hopefully it works fine.
donno out :p
donno,

why not compile using .net 1.1 so everyone can use it?

many people will not install 2.0 until it has "proven" itself a little longer in the real world.


- TeknoJuce - 2006-01-09

nad any information on how to play songs individually from a playlist file from the httpapi.. like select a song from the middle of the playlist and start playing it..


- nad - 2006-01-09

teknojuce: use setplaylistsong(position)

jmarshall: passing a parameter of a file that does not exist to g_applicationmessenger.mediaplay crashes the player. however, you won't be able to test this through the api because i have put a check on the file's existence in the playfile command.


- TeknoJuce - 2006-01-11

is there anyway to create a playlist and save it throught the httpapi?

i know you can add del and clear so far Smile

also is there any chance to add if its not already there..
Quote:teknojuce: use setplaylistsong(position)
setplaylistsong(directory/filename.ext) in playlist..

exSmile
11-01-2006 01:51:47 debug webs: accept request
11-01-2006 01:51:47 debug httpapi start command: setplaylistsong paras: setplaylistsong; e:\videos\teknovids\ziegelei-wiedereroeffnung-loq.wmv
11-01-2006 01:51:47 debug cplayercorefactor::getplayers(f:\music\trance\dance project - lost and away.mp3)
11-01-2006 01:51:47 info paplayer: end of playback reached
11-01-2006 01:51:47 info mp3codec: loaded decoder at 0095e490
11-01-2006 01:51:48 info pap player: playing f:\music\trance\dance project - lost and away.mp3

i told it to play the video on the list but instead it played the first item on the list.. which was an mp3...

getplaylistsong([position])
retrieves either:
if position is not specified, the position within the current playlist of the currently playing song
!hmm--> or the file name of the song at position position within the current playlist.






- nad - 2006-01-11

technojuce: setplaylistsong takes an integer parameter which is the position or the required media within the current active play list.

there is an addtoplaylist command.

have you seen the api docs which is on the sourceforge xbmc download page?

you can't create a play list file itself through the api. however, most play list file syntax is very straightforward so you should be able to do this yourself through some client code and then use the api to upload the file, fileupload.