Kodi Community Forum

Full Version: subtitles: get current state
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a button in my OSD to switch subtitles on or off. However I would like to turn this into a togglebutton and display the currently selected state.

I tried using System.GetBool(defaultvideosettings.showsubtitles) as a condition, but that doesn't seem to work. Is there a way to do this?
I guess that doesn't work because it's also saved per video.
So You need Boolean condition "VideoPlayer.SubtitlesEnabled" to check if currently played video has subtitles ?
Yes, to be more precise checking whether or not subtitles are enabled for the currently playing video. It would also be useful for positioning the OSD based on whether or not subtitles are enabled.

Maybe formatting it like VideoPlayer.HasSubtitles would be more consistent with other conditions?
sure, that's what I meant - HasSubtitles may indicate that there are subtitles for video available (not that subtitles are actually enabled/disabled) I think, but If You will come up with better name for it, I'll use it
Both.

HasSubtitles to hide the button

SubtitlesEnabled when they're on
added to master - see commit description https://github.com/xbmc/xbmc/commit/79a6...9e18fc6fef
Thanks for this and all the skin features you've added pieh.
Great Smile Thanks a lot pieh, it's appreciated
Wiki is updated.
Thanks Big_Noid, please just mark that these aren't available in dharma so there won't be confussion and bug reports about it.