pythonadd-onxbmckodi

How can I run an XBMC/Kodi video-plugin in python script?


I am trying to develop an XBMC/Kodi addon and my goal is run script and plugins from python script. There are buttons in addon.py when you pushed them, the addon that specified will run. I achieved this for picture and game add-on. Like this:

if control == self.button1:
  xbmc.executebuiltin("RunScript(script.game)")
if control == self.button2:
  xbmc.executebuiltin("RunScript(script.picture)")

I tried this way to call video plugin, but give me some error message. When I searched this problem, I found this:

"Do not try to run Plugins files from the scripts window as that will only give you a weird error message"

Is there an another way to call a video plugin from python script or can we a write a video-script instead of plugin?


Solution

  • You should call video plugin as follow:

    xbmc.executebuiltin("ActivateWindow(<window-id>,'plugin://<plugin-id>/<parameter-optional>',return)")
    ex.
    xbmc.executebuiltin("ActivateWindow(10025,'plugin://plugin.video.example/',return)")
    

    from kodi 17 window ID for video plugin is 10025