Class CaptionPosition.Builder
java.lang.Object
com.jwplayer.pub.api.configuration.CaptionPosition.Builder
- Enclosing class:
- CaptionPosition
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Builder(CaptionPosition src) This constructor fills the builder with data from an existing CaptionPosition in case you need to duplicate one and make a small change. -
Method Summary
Modifier and TypeMethodDescriptionSets the alignment of the caption text within the caption box.build()horizontalPosition(Integer horizontalPosition) Sets the leading edge of the caption box as a percentage of the rendered video width.Sets the vertical position of the caption box as a line count.linePercentage(Integer linePercentage) Sets the top edge of the caption box as a percentage of the rendered video height, measured from the top.Sets the width of the caption box as a percentage of the rendered video width.
-
Constructor Details
-
Builder
public Builder() -
Builder
This constructor fills the builder with data from an existing CaptionPosition in case you need to duplicate one and make a small change.- Parameters:
src- the position to copy.
-
-
Method Details
-
width
Sets the width of the caption box as a percentage of the rendered video width. When left unset, the box is sized to fit the caption text.- Parameters:
width- the width as a percentage; values outside [0, 100] are clamped into range, andnullrestores the default.
-
alignment
Sets the alignment of the caption text within the caption box.- Parameters:
alignment- one of theALIGNMENT_constants.
-
horizontalPosition
Sets the leading edge of the caption box as a percentage of the rendered video width. When left unset, the box is centered horizontally.- Parameters:
horizontalPosition- the position as a percentage; values outside [0, 100] are clamped into range, andnullrestores the default.
-
linePercentage
Sets the top edge of the caption box as a percentage of the rendered video height, measured from the top.Calling this clears any value set by
lineIndex(Integer), as the two describe the same axis. iOS rejects a position carrying both atbuild()time; this builder takes the value set last instead, so that a position can be adjusted without having to clear the other property first.- Parameters:
linePercentage- the position as a percentage; values outside [0, 100] are clamped into range, andnullrestores the default.
-
lineIndex
Sets the vertical position of the caption box as a line count. A non-negative value counts lines down from the top of the rendered video; a negative value counts lines up from the bottom, so-1is the bottom line.Calling this clears any value set by
linePercentage(Integer)— see the note there.- Parameters:
lineIndex- the line count, ornullto restore the default.
-
build
-