<onclick>ShowSubtitles</onclick> Broken?
#1
Question 
I recently tried to use ShowSubtitles for a button

Code:
<control type="button" id="14">
<description>OSD Subtitles</description>
<include>Animation_ButtonFocus</include>
<height>60</height>
<width>60</width>
<texturefocus>osd/osd_button_sub_fo.png</texturefocus>
<texturenofocus>osd/osd_button_sub_nf.png</texturenofocus>
<onclick>Close</onclick>
<onclick>ShowSubtitles</onclick>
<visible>VideoPlayer.HasSubtitles</visible>
</control>
and it does nothing. (aside from closing the OSD)

Hell, I even tried:
Code:
<onclick>XBMC.PlayerControl(ShowSubtitles)</onclick>
same thing, nothing.

Am I using it wrong?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#2
<onclick>ShowSubtitles</onclick> works ok for me in confluence / xbmc nightly build.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
I'm on OpenELEC-ION.x86_64-3.2.3 (12.2 Git:97A9F05). Must be just this build then, thanks for confirming. I guess I'll have to wait for 3.2.4 or something.

Not the end of the world, XBMC is still the greatest media player in the world, subtitle button or no subtitle button.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#4
Ok, so I thought it was just my OpenElec build so I figured I'd wait until an update, but I tried my Stable windows build from the main download site, and the last two nightlies, none turn off the subtitles when I execute a <onclick>ShowSubtitles</onclick>.

In addition, the the XBMCSetup-20131109-21c1810-master doesn't even play mp4 based embedded subtitles (external srts still work)

What am I doing wrong?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#5
Not sure if these two are connected, but i tried to use the new subtitle popup thing from Gotham with 12.2, but the actions would not do anything.

Only action that did something was <onclick>XBMC.RunScript($INFO[Skin.String(SubtitleScript_Path)])</onclick>

All the remaining 3 were translated from button presses to XBMC actions based on the debug log, but nothing happened.

<onclick>SubtitleDelay</onclick>
<onclick>NextSubtitle</onclick>
<onclick>ShowSubtitles</onclick>

Since it seeming sends regular onclicks it doesn't need a specific XBMC build, or does it?

I'm talking about https://github.com/xbmc/xbmc/blob/master...deoOSD.xml and lines 533-594.
Reply
#6
Here is the code, it displays a "Subtitle" button that if pressed when the movie has subtitles, turns them off or on, if there are none, it launches the subtitle script to download some. It doesn't work on any build I have though, it does launch the script if the file has no subtitles, but if it does have them, it does nothing and the subtitles just stay on or off depending on what state the OSD left it set to.

Code:
                <control type="button" id="14">
                    <description>OSD Subtitles</description>
                    <include>Animation_ButtonFocus</include>
                    <height>60</height>
                    <width>60</width>
                    <texturefocus>osd/osd_button_sub_fo.png</texturefocus>
                    <texturenofocus>osd/osd_button_sub_nf.png</texturenofocus>
                    <onclick>Close</onclick>
                    <onclick>XBMC.RunScript(script.xbmc.subtitles)</onclick>
                    <visible>!VideoPlayer.HasSubtitles</visible>
                </control>
                <control type="button" id="17">
                    <description>OSD Subtitles</description>
                    <include>Animation_ButtonFocus</include>
                    <height>60</height>
                    <width>60</width>
                    <texturefocus>osd/osd_button_sub_fo.png</texturefocus>
                    <texturenofocus>osd/osd_button_sub_nf.png</texturenofocus>
                    <onclick>Close</onclick>
                    <onclick>ShowSubtitles</onclick>
                    <visible>VideoPlayer.HasSubtitles</visible>
                </control>

Ideas? Is it me? Could all of my builds all be bad?
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#7
Found this thread by searching for "<onclick>ShowSubtitles</onclick>"

I am making my own mini VideoOSD and placed a button for enabling/disabling subtitles with the mentioned onclick.
I can confirm that it doesn't work for me as well ... running 12.2 Frodo.

The command does work when mapped to a key, but doesn't in the skin with the onclick.
Reply
#8
It possibly depends where you're calling it from if this is Frodo - i.e. it may be window-specific.

In Gotham, it's handled by the player controller so is no longer window-specific.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#9
Thanks jmarshall, hopefully it's sorted out in Gotham, so won't worry about it now.
Reply
#10
Cool, cool, cool.

For reference it was being called from VideoOSD.xml.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#11
Just tried it on xbmc-13.0-Gotham_alpha9.exe, same thing, it does nothing to the state of subtitles, if they're on, the stay on, if they're off, they stay off.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#12
It's still broken in Jan 24, 2014 Windows nightly.
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#13
Yeah - this is because these actions are only handled in fullscreen (I thought they were handled in the playercontroller, but they're not).

It may or may not be an easy fix - will have to be explored.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#14
I did get it to work, but it isn't really very easy to understand from the wiki.
http://forum.xbmc.org/showthread.php?tid...pid1012543
had a working example.
Code:
<onclick>Dialog.Close(VideoOSD,true)</onclick>
      <onclick>NextSubtitle</onclick>
works from VideoOSD.xml
Using a NUC7PJYHN and a 2820FYKH0 Intel NUC running LibreELEC, and two FireTVs.:)
Reply
#15
Yup, as the second <onclick> is done in the context of fullscreen.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
<onclick>ShowSubtitles</onclick> Broken?0