Class CaptionsConfig.Builder
java.lang.Object
com.jwplayer.pub.api.configuration.CaptionsConfig.Builder
- Enclosing class:
- CaptionsConfig
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Builder(CaptionsConfig src) This constructor fills the builder with data from an existing CaptionsConfig in case you need to duplicate one and make a small change. -
Method Summary
Modifier and TypeMethodDescriptionallowScaling(boolean allowScaling) Sets whether the device's accessibility caption/font scale is applied on top of the caption size.backgroundColor(Integer backgroundColor) Sets the color rendered directly behind the caption glyphs (the "highlight").build()Sets the caption text color.Sets the edge style applied around caption text.fontFamily(String fontFamily) Sets the caption font family (e.g.Sets the caption font size in Android scaled pixels (sp).overrideStrategy(String overrideStrategy) Sets the strategy governing whether developer-provided styles override the device's accessibility caption settings.position(CaptionPosition position) Sets the default position, width and text alignment of captions within the rendered video.windowColor(Integer windowColor) Sets the color of the window/box behind the whole caption region.
-
Constructor Details
-
Builder
public Builder() -
Builder
This constructor fills the builder with data from an existing CaptionsConfig in case you need to duplicate one and make a small change.- Parameters:
src- the config to copy.
-
-
Method Details
-
fontSize
Sets the caption font size in Android scaled pixels (sp). When set, this size is used as the base size and overrides the player's automatic sizing. SeeCaptionsConfig.getFontSize()for how the unit relates to the other platforms.- Parameters:
fontSize- the size in sp;null, zero and negative values leave the player's automatic sizing in place.
-
fontFamily
Sets the caption font family (e.g."sans-serif","serif","monospace").- Parameters:
fontFamily- the font family name.
-
color
Sets the caption text color. The color's alpha component sets the text opacity.- Parameters:
color- the text color, including opacity.
-
backgroundColor
Sets the color rendered directly behind the caption glyphs (the "highlight"). The color's alpha component sets the opacity. When left unset, the highlight defaults to an opaque black box (Android's default caption rendering); pass a color with alpha0to remove it. This is distinct from the caption window (windowColor(Integer)).- Parameters:
backgroundColor- the highlight color, including opacity.
-
windowColor
Sets the color of the window/box behind the whole caption region. The color's alpha component sets the opacity. Use this to place captions on a solid or translucent background for legibility.- Parameters:
windowColor- the window color, including opacity.
-
edgeStyle
Sets the edge style applied around caption text.- Parameters:
edgeStyle- one of theEDGE_STYLE_constants.
-
position
Sets the default position, width and text alignment of captions within the rendered video. Applies only to cues that carry no positioning of their own; seeCaptionPositionfor the precedence rules and the coordinate space.- Parameters:
position- the caption position, ornullto leave the player's positioning in place.
-
overrideStrategy
Sets the strategy governing whether developer-provided styles override the device's accessibility caption settings.- Parameters:
overrideStrategy- one of theOVERRIDE_STRATEGY_constants.
-
allowScaling
Sets whether the device's accessibility caption/font scale is applied on top of the caption size. Defaults totrue. SeeCaptionsConfig.getAllowScaling().- Parameters:
allowScaling-trueto apply the accessibility scale,falseto use the configured or automatic size as-is.
-
build
-