Kodi Community Forum

Full Version: Add Button to a Python Plugin for XBMC on the Home Screen Menu?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm trying to get a button to the iPlayer plugin on my home screen. I have it all there, just have no idea how to actually link it to the iPlayer button. Can anybody help?
This is what I have currently (obviously, it's the onclick part that's wrong, I just guessed that bit Tongue)

Code:
<item id="12">
<label>iPlayer</label>
<onclick>ActivateWindow(plugin://iPlayer/)</onclick>
<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
</item>
PHP Code:
<!-- Custom Button -->
<
control type="button" id="3507">
    <
label>iPlayer TV</label>
    <
onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
    
<include>Home_MainMenuLabel</include>
</
control

Hitcher posted this in an Alaska thread, maybe it will help you find the right bit of code?

Its very similar to yours, I think it should be easy enough.
Not tested, but this is my guess.

PHP Code:
<!-- Custom Button -->
<
control type="button" item id="12">
    <
label>iPlayer TV</label>
    <
onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
    
<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
</
control

Which file are you editing to make the button? Home? I was looking in there, around line 425?

Let me know if you get it working, I might add it too
Code:
<onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
Thankyou, this works perfectly.

I am editing home.xml. But it's around line 850. This is where additions and changes to the main home menu are done.

It's very cool having an iPlayer button on the home screen now Big Grin

And if you're interested, I'm using this image as the background for it.
Glad it helped.

I've added it now too Big Grin is there any way to make the iPlayer text show as iPlayer, not IPLAYER?

Cheers
t2ffn Wrote:is there any way to make the iPlayer text show as iPlayer, not IPLAYER?

I'm not 100% sure how to achieve this. But you can change the font used for all the home menu items to use lowercase letters (as well as uppercase).

Around line 750 (for me) you can choose the font used.
Just search for
Code:
<font>font50caps_title</font>
There should be two instances of it, one for when the text is selected, and one for when it isn't.

You might have to open Font.xml to check or edit the current fonts.


I haven't really tried it out much, but it might give you something to play around with, or until someone else comes along with a better answer Big Grin
Had a play with a few things but can't make it iPlayer, mixed upper lower case just yet, but think it needs it, just looks odd all caps.

Its a nice little feature to have it on the home screen though, good work.
Could someone help describe how to change just the iplayer label from IPLAYER to iPlayer on the home screen please.

Tried a few font commands but none worked.
great stuff......how do i add the iplayer picture you posted?Big Grin

many thanks
Save it to the backgrounds folder, then change the link in the above code to match your structure:

<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
<icon>//720P/backgrounds/iplayer.jpg</icon>

Only you know the path.
sorted

thanksBig Grin
Many thanks for this thread - really nice having iplayer at the top level. To make this complete tho is it possible to get the channels / categories on the submenu?

p.s. - anyone got any better background images up for grabs than the one earlier in this thread? I scoured google and flickr for something better and drew a big blank...

Cheers! Shoesy x
Guys,

I've tried to follow what was posted here by editing my home.xml, but I can't seem to get it to work at all, could you please post your home.xml here?

Or if possible give a little more detail on how you got this to work?

Im running xbmc9.11 with no mods btw.

When I edited my home.xml to include your code:

<!-- Custom Button -->
<control type="button" item id="12">
<label>iPlayer TV</label>
<onclick>ActivateWindow(24,plugin://video/IPlayer/?tvradio=tv)</onclick>
<icon>/home/pictures/backgrounds/iplayer.jpg</icon>
</control>

XBMC would not let me re-enable the aeon skin. (I changed the iplayer.jpg path to the correct location for my pc)

What do type="button" and item id"=12" correspond to?
Why the hell would you be enabling the aeon skin? You're in Confluence section...
Shoesy Wrote:To make this complete tho is it possible to get the channels / categories on the submenu?

I'd like to do this as well.

I've got the submenu sorted out, but I have no idea how to activate, say, the live BBC One stream on click. Is this possible?

So the same way to code previously mentioned in this thread, "ActivateWindow(24,plugin://video/iPlayer/?tvradio=tv)" tells XBMC to go straight to the TV section, is it possible to go TV -> Watch Live -> BBC One?
Pages: 1 2