def onClick(self, controlID):
clicked_control=self.getControl(controlID)
#log('clicked on controlID='+repr(controlID))
#button control does not have a property, we use a different method.
value_to_search=clicked_control.getLabel() #we'll just use the Property('link_url') that we used as button label to search
listitems=self.listing
li = next(l for l in listitems if l.getProperty('link_url') == value_to_search)
item_type=li.getProperty('item_type')
di_url=li.getProperty('onClick_action')
log( " clicked %s IsPlayable=%s url=%s " %( repr(clicked_control),item_type, di_url ) )
if item_type=='playable':
#a big thank you to spoyser (http://forum.kodi.tv/member.php?action=profile&uid=103929) for this help
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(di_url, value_to_search)
xbmc.Player().play(pl, windowed=False)
elif item_type=='script':
self.busy_execute_sleep(di_url,5000,False)
评论列表
文章目录