get selected list item from plugin
#1
Hi,

After adding contents via addDirectoryObject to render the control list, is it possible to retrieve the selected list item? The reason is this, I have a JSON file which include all the info that I need to create the list item with the appropriate "info labels" but not the stream url, which require an additional http request. When I click on the ListItem, it grabs the stream and play it, but I like to pass along the listitem for the info. Or would it be easier to just pass all the relevant info to the function that play the video?

Thanks,[/code]
Reply
#2
actually thats what i dont like of using the addDirectory script/plugin.. you have no control over the plugin or barely any control at all..
and its SLOW as hell.

I dont know the answer toyour question, but im dealing with tv channels with epg now, next and information for the current programing like start time and endtime,poster and whatnot and had to use json files to retrieve all the information.

Word of advice, use xbmcgui.Window class and use ControlList and draw the screen to your liking, theres a method to get the selected item and then you can parse your json and retrive the information, i hope you can get a better answer than mine but really you will hit a brick wall eventually if you dont draw your own window..
Reply
#3
The best way I've found is to store the json info in a window property and then grab it from your function that resolves the playable url.

Alternatively, if all of your info happens to be within this set: http://wiki.xbmc.org/?title=InfoLabels#Listitem
Those will always be set to the last listitem passed to xbmc, so if you haven't yet created another listitem, you can use xbmc.getInfoLabel() to grab them
Reply

Logout Mark Read Team Forum Stats Members Help
get selected list item from plugin0