Kodi Community Forum

Full Version: <onclick>ShowSubtitles</onclick> Broken?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
<onclick>ShowSubtitles</onclick> works ok for me in confluence / xbmc nightly build.
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.
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?
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.
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?
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.
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.
Thanks jmarshall, hopefully it's sorted out in Gotham, so won't worry about it now.
Cool, cool, cool.

For reference it was being called from VideoOSD.xml.
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.
It's still broken in Jan 24, 2014 Windows nightly.
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.
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
Yup, as the second <onclick> is done in the context of fullscreen.