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


- TeknoJuce - 2006-02-14

acually the problem exists with playfile.. as i have reported many times in the past... playfile cannot play a playlist on startup... one has to be first loaded manually with the controller and then it will fuction.. a way around this is to use the external player command playmedia... :o
which should not be the solution but it works until its fixed Sad

xboxip/xbmccmds/xbmchttp?command=execbuiltin&parameter=xbmc.playmedia(blah.m3u)

Quote:posted: dec. 23 2005,14:17

:help: 2.) playfile wont play .m3u from a fresh boot, unless it was previously loaded manually with the controller but the external command playmedia does load the m3u..
forum post


date submitted:
2005-12-28 03:38
bug report here






- kraqh3d - 2006-02-14

i wouldnt call it bug. as far as i can tell, its working as it should. here's the pertinent code from playfile:

Quote: if (item.isplaylist())
{
loadplaylist(paras[0], g_playlistplayer.getcurrentplaylist(), false, false);
g_applicationmessenger.playlistplayerplay(0);
return setresponse(opentag+"ok:playlist");
}
the code in loadplaylist appends the items from the playlist (paras[0]) to the current playlist (g_playlistplayer.getcurrentplaylist()).

the problem you're facing is because you're using it wrong. this is because "g_playlistplayer.getcurrentplaylist()" is not initialised until something is playing or until you initialise it yourself. you need to call "setcurrentplaylist" before using playfile.


- TeknoJuce - 2006-02-14

well it should be smarter then that and just do that in the first place cause why would you want to initialize 2 commands when you could just do it in one "playfile" to me would mean exactly that.. inless of course we want people just to continue using playmedia instead.. no biggy i guess.. Smile

id also still call it a bug cuz its saying to the user yup playlist is working.. when it should say error you must initilize 72 other commands before this fuctions properly   :nuts: else maybe change the command to playfileonlyifmeetsspecialrequirements&parameter=yay!






- kraqh3d - 2006-02-14

easily done to through out an error that there's no current playlist defined.

the problem is that how you've assumed it should work, does not match how the author assumed it should work. for a playlist it doesnt even play the file. it appends the files to the current playlist. the current implementation met the author's needs.

** edit **
actually, looking the code. it definately needs to be revised. i propose this...

if its a playlist, you can define the playlist you want as a parameter. if its not defined as a parameter, it assumes the current playlist. and if theres no current playlist, then it errors saying you need to define it.

but should it clear the playlist first, or append them and start playback from the point of insertion?






- TeknoJuce - 2006-02-14

just link playfile to playmedia or copy the code 1:1 cuz theres really no reason for it..

edit:
Quote:** edit **
actually, looking the code.  it definately needs to be revised.  i propose this...

if its a playlist, you can define the playlist you want as a parameter.  if its not defined as a parameter, it assumes the current playlist.  and if theres no current playlist, then it errors saying you need to define it.  
in gereral playmedia does it automagically why cant it?
but if it really has to be this way...
yes if you mean add it to the end as a parameter ";" etc thats better. few things are still fuzzy why we need differnet playlist options when you can add videos to the same audio playlist and visavi which it should be this way..

Quote:but should it clear the playlist first, or append them and start playback from the point of insertion?
if you open a playlist clear list.. if you want to append files to that current list use another command..






- kraqh3d - 2006-02-14

Quote:just link playfile to playmedia or copy the code 1:1 cuz theres really no reason for it..
i need to review it more before doing that. changing its operation could adversely affect another application using this api.


- TeknoJuce - 2006-02-14

unless of course we want to make tons of other commands like
loadplaylist
newplaylist
addplaylistfiletoplaylist
playplaylist
playvirtual(temp)playlist
savecurrenttempplaylist&paramerter=videoandmusic.m3u

in general a playlist is just that a list of files to play one after another i dont see why we need 4 differnt playlist options. to say if its video or audio.. thats what naming them is for.. someaudioalbum.m3u somemusicvideos.m3u mixofmusicvideosandsongs.m3u

ever playlist we should load should be dumped in to 1 virtual(temp) list even if its not from a file or is loaded from a file and then should be played from there. / edited / updated / savednew.

Quote:i need to review it more before doing that.  changing its operation could adversely affect another application using this api.
maybe in that case just make another command like sugested above that just copies the playmedia funtion or if that error msg you were gunna add make it just an else to function like playmedia if no playlist is specifide.






- kraqh3d - 2006-02-14

each playlist is identified by a number. there are four playlists, as i explained earlier. the httpapi needs to work in the confines of this system and does a pretty good job already.

the majority of the playlist related commands accepts a playlist parameter, and when its not supplied, it assumes the current playlist.

the builtin playmedia command works around this by just always using the playlist_music_temp playlist.

to keep playfile in line with the other playlist functions, i've modified it to accept a second parameter so you can pick the playlist. this is only used if the file is a playlist. then like the other commands, if a playlist parameter is no supplied, then it'll try to use the current playlist. and if there is no current playlist, it'll arbitrarily use playlist_music_temp like the builtin "playmedia" command.


- TeknoJuce - 2006-02-14

yeah i know how playlist work in general from the httpapi point of view which i wouldnt say is very user friendly and have shown that ive used them so you dont have to keep re-explaining that portion, im just stating how i see it in general no harm/foul, just stating there shouldnt be 4 diff types but thats not really any of your concern more of a overall player thing, beacuse in the end its just a list of files as i stated above to be played in order and shouldnt matter what they are. but maybe with your addition here will upgrade that +1 we will see once added/compiled.. Smile






- kraqh3d - 2006-02-14

Quote:just stating there shouldnt be 4 diff types but thats not really any of your concern more of a overall player thing
each media type has two playlists so that you can play tihngs in a simple manner, and not disturb the now playing queue. this is where the temp playlist comes in. this way, when you play a file with autoplay next item enabled, or if you play a folder, they are played thru the temp playlist because its always explicitly cleared before playback. (otherwise you'd loose your now playing queue, and that would annoy many people.) a single file is always played without the need for a playlist

this api provides access into xbmc inner workings so all the playlists are exposed. you dont need to use them. the first thing your application can do is setcurrentplaylist to 0. then you can pretty much ingore them. however, you need to watch out because some functions may explicitly clear the current playlist. as an example, playfile with a playlist parameter will now do such a thing.






- TeknoJuce - 2006-02-14

great cant wait to try it out


- kraqh3d - 2006-02-14

fyi, i just committed this change.


- cliosport - 2006-02-15

i been using v0,97 and everything worked just fine today i upgraded to the latest and puted the files in program files\xbmc


when i open the folder files\xbmc i can only se the controller.map and the controller.jpg and then the ppc hangs and i need to reset itSad

any idea?

thanks


- TeknoJuce - 2006-02-15

lastest t3ch or latest you compiled..


- cliosport - 2006-02-15

i downloaded it from the link on the first page.