Kodi Community Forum

Full Version: Extending a skin through a service addon
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,
I am writing a service addon that displays dynamic information when video is played. I am achieving this by modifying the VideoFullscreen.xml file with additional controls. I am wondering if this could be achieved from the addon itself; therefore the controls will be added to any user selected skin. Is there any way to extend VideoFullscreen.xml of the skin being used with additional controls from the service addon.
Thanks.
i'm not sure if that's possible.

you could use the Window class to add controls to existing windows,
but iirc all controls in VideoFullscreen.xml need to have an id="1".
as far as i can tell from our python docs it's not possible to assign an id.
Thanks for the pointer. I don't think there is any such restriction on the control as I am able to pass IDs like of any integer in the xml file.

When we create image control there is a restriction that the image file be packed in the special file inside media folder. Do you know if such restrictions are there when image control is created using Python from adding? I would really appreciate any pointer to an existing addon that may do this.
yeah, but i think you can't pass any id from python at all.
as a result the controls won't show up in the fullscreen video window.
but go ahead, it wouldn't hurt to try if you can get it to work.

you can just provide the images you need with your addon, that should not be a problem at all.

i have no idea which addons are using the Window class to add control to an existing window.
Ok thanks. I will update you how it goes.
I also found some clues here: 212811 (thread)
xbmcgui.Window(id) returns the existing window with given id; This object can be used to add controls.
In my case, I just had to:
win = xbmcgui.Window(12005)
win.addControl(Control)

This works fine. But the added control will disappear if skin is changed. But will appear again the next time the device is restarted. This is not a problem in my use case.

I notice that the python API only exposes only a subset of features available in XML file. Or am I missing something. For exampe, fadetime in imagecontrol and shadowcolor in labelcontrol.
yup the Window class only provides a subset of what is normally available to skins.