Solved How to 'integrate' a plugin into the skin?
#1
Thread title has weird wording but I didn't know how to explain myself better.

I thought about creating a custom window .xml for them but they both load window 10025 and MyVideoNav by default.
Also my Python knowledge is very, very limited so I can't go digging in the code and change things there.
Changes to Youtube aren't really necessary if it's too much work, but I'd like to change Twitch so that it has a background at least (in stead of my Default), setting a background for it in the settings doesn't have any effect.

Code:
Activating window ID: 10025
------ Window Deinit (Home.xml) ------
------ Window Init (MyVideoNav.xml) ------
CGUIMediaWindow::GetDirectory (plugin://plugin.video.twitch/
ParentPath = [plugin://plugin.video.twitch/createFollowingList/]
Loading items: 11, directory: plugin://plugin.video.twitch/createFollowingList/ sort method: 0, ascending: false

Code:
Activating window ID: 10025
------ Window Deinit (Home.xml) ------
------ Window Init (MyVideoNav.xml) ------
CGUIMediaWindow::GetDirectory (plugin://plugin.video.youtube/)
ParentPath = [plugin://plugin.video.youtube/]
Loading items: 5, directory: plugin://plugin.video.youtube/ sort method: 0, ascending: false
Reply
#2
Would something like this work if I put it in MyVideoNav?
Code:
<control type="image" description="twitch bg">
<visible>System.HasAddon(plugin.video.twitch)</visible>
...
<texture>common/twitchbackground.png</texture>
</control>

I'm guessing this will display the image on all pages which use MyVideNav though
edit: Yes it does.
Reply
#3
Yes, but you have to use a condition like this:
<visible>SubString(Container(id).FolderPath,plugin.video.twitch)</visible>

Don't forget to add the ID of the content container, because that image control is outside of it.

Your example visibility condition returns True if the addon is installed and activated, no matter in which window you are.

See available info labels:
http://kodi.wiki/view/InfoLabels#Container
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#4
Awesome, I'm not fully understanding how Substrings work yet but this does the job. Thank you

I'm guessing it's not possible at all to have it load a different xml without editing the code?
Reply
#5
StringCompare(Foo,bar) -> Returns True if the string "Foo" matches exactly the string "bar". If the string is "bar123", it returns False.
SubString(Foo,bar) -> Returns True if "bar" is found in "Foo". Even if it's "jabadabaafoooooo"

You always have to edit the xmls.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#6
I mean to make it so the plugin doesn't load MyVideoNav.xml by default, but a custom one I set up.
I'm guessing this is hardcoded in the .py files somewhere, but I'm not sure how plugins work and how they're set up.

Also, nice exampleTongue
Makes perfect sense now, and looks like a very useful function.
Reply
#7
This is how a common video plugin is handled by Kodi. Video addons will be opened in MyVideoNav.xml, music addons in MyMusicNav.xml etc.
Don't get me wrong, but I suggest you to learn more about the Kodi skin/window structure before you mix more things up as you already did.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#8
Well, I just started learning how to skin Kodi by editing an already existing skin.
I've already come quite far, and I've already learned a bunch of things, both thanks to the wiki and people here.

Not sure what you exactly mean with "learn more about the Kodi skin/window structure before you mix more things up"
but that's the reason why I'm here. Smile
Reply
#9
What I mean is, that you can start taking care of addons as soon as you are able to read Kodi skins like they would be a normal book Wink

A way how backgrounds are handled by skinners is adding something like this to each .xml, which should have a background rule:
PHP Code:
<include>BackgroundImage</include> 

The include is defined in a include xml:
PHP Code:
<include name="BackgroundImage">
<
control type="image">
<
width>1920</width>
<
height>1080</width>
<
texture background="true">$VAR[BackgroundImage]</texture>
</
control>
</include> 

Example VAR definition:
PHP Code:
<variable name="BackgroundImage">
<
value condition="SubString(Container.FolderPath,twitch)">MyTwitchBG.png</value>
<
value condition="Window.IsActive(videolibrary)">$INFO[ListItem.Art(fanart)</value>
.....
.....
....
<
value>DefaultBackground.png</value>
</
variable

That's a common simple way without using hundred of code lines.
Hint: Kodi always uses the first value that is True. In the $VAR example the background will be the Twitch one, even if we set a more "global" condition in the next row for the same window.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#10
That is something I already knew, kinda. I've created my own variable to show time and date everywhere in the top right corner, except on HOME or when a video is active. Including a black bar image in which it sits.

You're right though by saying that I shouldn't dive in too deep too quickly.
But I like tinkering with stuff to make it exactly how I want and because I'm not skilled enough to create my own I used Amber (which I really like) as base.
Then I just check out every part of it to see what I'd like to change, and then I just do it.
Maybe not the best way to start learning things, but maybe it is. Often times you learn the most by attempting stuff you have no clue about.
If I hadn't asked this question, you wouldn't have explained the substring method to me, and I probably wouldn't have used that by discovering it myself. (practical usage is not the best explained on the wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
How to 'integrate' a plugin into the skin?0