SubtitleView
class SubtitleView@JvmOverloadsconstructor(context: Context, attrs: AttributeSet? = null) : SubtitleRendererView
A view that renders subtitles for a Player. Can be used to customize subtitles rendering when subtitles are not already rendered as part of the PlayerView's UI handling (see UiConfig.Disabled).
Constructors
| SubtitleView | @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) |
Functions
| Name | Summary |
|---|---|
| setApplyEmbeddedFontSizes | open override fun setApplyEmbeddedFontSizes(applyEmbeddedFontSizes: Boolean) Sets whether font sizes embedded within the cues should be applied. Enabled by default. Only takes effect if setApplyEmbeddedStyles is set to true. |
| setApplyEmbeddedStyles | open override fun setApplyEmbeddedStyles(applyEmbeddedStyles: Boolean) Sets whether styling embedded within the cues should be applied. Enabled by default. Overrides any setting made with setApplyEmbeddedFontSizes. |
| setBottomPaddingFraction | open override fun setBottomPaddingFraction(bottomPaddingFraction: Float) Sets the bottom padding fraction to apply when getLine is DIMEN_UNSET, as a fraction of the view's remaining height after its top and bottom padding have been subtracted. |
| setFixedTextSize | open override fun setFixedTextSize(unit: Int, size: Float) Set the text size to a given unit and value. |
| setFractionalTextSize | open override fun setFractionalTextSize(fractionOfHeight: Float) Sets the text size to be a fraction of the views remaining height after its top and bottom padding have been subtracted. open override fun setFractionalTextSize(fractionOfHeight: Float, ignorePadding: Boolean) Sets the text size to be a fraction of the height of this view. |
| setPlayer | open override fun setPlayer(player: Player?) Set the Player for which the Cues should be rendered. |
| setStyle | open override fun setStyle(style: CaptionStyle) Sets the caption style. |
| setUserDefaultStyle | open override fun setUserDefaultStyle() Sets the caption style to be equivalent to the one returned by getUserStyle, or to a default style before API level 19. |
| setUserDefaultTextSize | open override fun setUserDefaultTextSize() Sets the text size to one derived from getFontScale, or to a default size before API level 19. |