How do you get a plugin to call itself and perform an action? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: How do you get a plugin to call itself and perform an action? (/showthread.php?tid=176207) |
How do you get a plugin to call itself and perform an action? - Kode - 2013-10-21 Anybody have any idea why the following doesnt work? If it's in the skin <onclick>PlayMedia(plugin://plugin.video.plexbmc?url=http://192.168.0.20:32400/library/metadata/21995&mode=11&t=7260639398)</onclick> works, but now I'm trying to use xbmcgui.listitem with.. Code: def add_listitem(item, thumb, path_to_play): where path_to_play is also PlayMedia(plugin://plugin.video.plexbmc?url=http://192.168.0.20:32400/library/metadata/21995&mode=11&t=7260639398) but this doesn't work Ay ideas? *edit* From what I have read, you can't pass PlayMedia as part of the path, and would have to call the plugin itself to initiate the playmedia, ive tried the following: Changing the path to plugin://plugin.video.plexbmc?playtype=video&url=http://192.168.0.20:32400/library/metadata/21995&mode=11&t=7260639398 and then in the plugin Code: try: but I'm obviously doing it in the wrong place and it doesnt work, it doesn't even hit the first printDebug RE: How do you get a plugin to call itself and perform an action? - divingmule - 2013-10-21 What are you adding the listitem to, a plugin directory RE: How do you get a plugin to call itself and perform an action? - Kode - 2013-10-21 to a control, so: Code: recent_movies = WINDOW.getControl(311) RE: How do you get a plugin to call itself and perform an action? - divingmule - 2013-10-21 So.. the control, WINDOW.getControl(311), is from some xml file or did you create it in python? RE: How do you get a plugin to call itself and perform an action? - Kode - 2013-10-21 specifically in this instance it's in the Amber skin include_plexbmc.xml *edit* The actual listing works fine, I can see all the thumbnails and scroll through them, just clicking on one does nothing RE: How do you get a plugin to call itself and perform an action? - divingmule - 2013-10-21 So.. you're running this from a python window class? I'm thinking you need to define onClick. This catches and returns the control id when the listitem is selected. Then you would have to do something like xbmc.Player().play( control.getSelectedItem()) Here is onClick example - https://github.com/divingmule/script.funnyordie/blob/master/default.py#L415 RE: How do you get a plugin to call itself and perform an action? - Kode - 2013-10-21 hmm, interesting, I will look into this, many thanks |