Class CaptionText
java.lang.Object
com.jwplayer.pub.api.media.captions.CaptionText
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceThe type of anchor, which may be unset.static @interfaceThe type of line, which may be unset.static @interfaceThe type of default text size for this cue, which may be unset.static @interfaceThe type of vertical layout for this cue, which may be unset (i.e. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAnchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box.static final intAnchors the middle of the cue box.static final intAnchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box.static final floatAn unset position, width or size.final floatThe position of the cue box within the viewport in the direction orthogonal to the writing direction (determined byverticalType), orDIMEN_UNSET.static final intstatic final intfinal @com.jwplayer.pub.api.media.captions.CaptionText.AnchorType intfinal @com.jwplayer.pub.api.media.captions.CaptionText.LineType intThe type of thelinevalue.final Layout.AlignmentThe alignment of multiple lines of text relative to the longest line, or null if the alignment is undefined.final floatThe fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline, orDIMEN_UNSET.final @com.jwplayer.pub.api.media.captions.CaptionText.AnchorType intThe cue box anchor positioned byposition.final floatThe shear angle in degrees to be applied to this CaptionText, expressed in graphics coordinates.final floatThe size of the cue box in the writing direction specified as a fraction of the viewport size in that direction, orDIMEN_UNSET.final CharSequenceThe cue text, or null if this is an image cue.static final intText size is measured in number of pixels.static final intText size is measured as a fraction of the viewport size minus the view padding.static final intText size is measured as a fraction of the viewport size, ignoring the view paddingfinal Layout.AlignmentThe alignment of the cue text within the cue box, or null if the alignment is undefined.final floatThe default text size for this cue's text, orDIMEN_UNSETif this cue has no default text size.final @com.jwplayer.pub.api.media.captions.CaptionText.TextSizeType intThe default text size type for this cue's text, orTYPE_UNSETif this cue has no default text size.static final intAn unset anchor, line, text size or vertical type value.static final intVertical left-to-right (e.g.static final intVertical right-to-left (e.g.final @com.jwplayer.pub.api.media.captions.CaptionText.VerticalType intThe vertical formatting of this CaptionText, orTYPE_UNSETif the cue has no vertical setting (and so should be horizontal).final intThe fill color of the window.final booleanSpecifies whether or not thewindowColorproperty is set. -
Constructor Summary
ConstructorsConstructorDescriptionCaptionText(CharSequence text, Layout.Alignment textAlignment, Layout.Alignment multiRowAlignment, float line, int lineType, int lineAnchor, float position, int positionAnchor, float size, boolean windowColorSet, int windowColor, int textSizeType, float textSize, int verticalType, float shearDegrees) -
Method Summary
-
Field Details
-
DIMEN_UNSET
public static final float DIMEN_UNSETAn unset position, width or size.- See Also:
-
TYPE_UNSET
public static final int TYPE_UNSETAn unset anchor, line, text size or vertical type value.- See Also:
-
ANCHOR_TYPE_START
public static final int ANCHOR_TYPE_STARTAnchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box.- See Also:
-
ANCHOR_TYPE_MIDDLE
public static final int ANCHOR_TYPE_MIDDLEAnchors the middle of the cue box.- See Also:
-
ANCHOR_TYPE_END
public static final int ANCHOR_TYPE_ENDAnchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box.- See Also:
-
LINE_TYPE_FRACTION
public static final int LINE_TYPE_FRACTION- See Also:
-
LINE_TYPE_NUMBER
public static final int LINE_TYPE_NUMBER- See Also:
-
TEXT_SIZE_TYPE_FRACTIONAL
public static final int TEXT_SIZE_TYPE_FRACTIONALText size is measured as a fraction of the viewport size minus the view padding.- See Also:
-
TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING
public static final int TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDINGText size is measured as a fraction of the viewport size, ignoring the view padding- See Also:
-
TEXT_SIZE_TYPE_ABSOLUTE
public static final int TEXT_SIZE_TYPE_ABSOLUTEText size is measured in number of pixels.- See Also:
-
VERTICAL_TYPE_RL
public static final int VERTICAL_TYPE_RLVertical right-to-left (e.g. for Japanese).- See Also:
-
VERTICAL_TYPE_LR
public static final int VERTICAL_TYPE_LRVertical left-to-right (e.g. for Mongolian).- See Also:
-
text
The cue text, or null if this is an image cue. Note theCharSequencemay be decorated with styling spans. -
textAlignment
public final Layout.Alignment textAlignmentThe alignment of the cue text within the cue box, or null if the alignment is undefined. -
multiRowAlignment
public final Layout.Alignment multiRowAlignmentThe alignment of multiple lines of text relative to the longest line, or null if the alignment is undefined. -
line
public final float lineThe position of the cue box within the viewport in the direction orthogonal to the writing direction (determined byverticalType), orDIMEN_UNSET. When set, the interpretation of the value depends on the value oflineType.The measurement direction depends on
verticalType:- For
TYPE_UNSET(i.e. horizontal), this is the vertical position relative to the top of the viewport. - For
VERTICAL_TYPE_LRthis is the horizontal position relative to the left of the viewport. - For
VERTICAL_TYPE_RLthis is the horizontal position relative to the right of the viewport.
- For
-
lineType
The type of thelinevalue.LINE_TYPE_FRACTIONindicates thatlineis a fractional position within the viewport (measured to the part of the cue box determined bylineAnchor).LINE_TYPE_NUMBERindicates thatlineis a viewport line number. The viewport is divided into lines (each equal in size to the first line of the cue box). The cue box is positioned to align with the viewport lines as follows:lineAnchor) is ignored.- When
lineis greater than or equal to 0 the first line in the cue box is aligned with a viewport line, with 0 meaning the first line of the viewport. - When
lineis negative the last line in the cue box is aligned with a viewport line, with -1 meaning the last line of the viewport. - For horizontal text the start and end of the viewport are the top and bottom respectively.
-
lineAnchor
The cue box anchor positioned bylinewhenlineTypeisLINE_TYPE_FRACTION.One of:
For the normal case of horizontal text,
ANCHOR_TYPE_START,ANCHOR_TYPE_MIDDLEandANCHOR_TYPE_ENDcorrespond to the top, middle and bottom of the cue box respectively. -
position
public final float positionThe fractional position of thepositionAnchorof the cue box within the viewport in the direction orthogonal toline, orDIMEN_UNSET.The measurement direction depends on
verticalType.- For
TYPE_UNSET(i.e. horizontal), this is the horizontal position relative to the left of the viewport. Note that positioning is relative to the left of the viewport even in the case of right-to-left text. - For
VERTICAL_TYPE_LRandVERTICAL_TYPE_RL(i.e. vertical), this is the vertical position relative to the top of the viewport.
- For
-
positionAnchor
@AnchorType public final @com.jwplayer.pub.api.media.captions.CaptionText.AnchorType int positionAnchorThe cue box anchor positioned byposition. One ofANCHOR_TYPE_START,ANCHOR_TYPE_MIDDLE,ANCHOR_TYPE_ENDandTYPE_UNSET.For the normal case of horizontal text,
ANCHOR_TYPE_START,ANCHOR_TYPE_MIDDLEandANCHOR_TYPE_ENDcorrespond to the left, middle and right of the cue box respectively. -
size
public final float sizeThe size of the cue box in the writing direction specified as a fraction of the viewport size in that direction, orDIMEN_UNSET. -
windowColorSet
public final boolean windowColorSetSpecifies whether or not thewindowColorproperty is set. -
windowColor
public final int windowColorThe fill color of the window. -
textSizeType
@TextSizeType public final @com.jwplayer.pub.api.media.captions.CaptionText.TextSizeType int textSizeTypeThe default text size type for this cue's text, orTYPE_UNSETif this cue has no default text size. -
textSize
public final float textSizeThe default text size for this cue's text, orDIMEN_UNSETif this cue has no default text size. -
verticalType
@VerticalType public final @com.jwplayer.pub.api.media.captions.CaptionText.VerticalType int verticalTypeThe vertical formatting of this CaptionText, orTYPE_UNSETif the cue has no vertical setting (and so should be horizontal). -
shearDegrees
public final float shearDegreesThe shear angle in degrees to be applied to this CaptionText, expressed in graphics coordinates. This results in a skew transform for the block along the inline progression axis.
-
-
Constructor Details
-
CaptionText
public CaptionText(CharSequence text, Layout.Alignment textAlignment, Layout.Alignment multiRowAlignment, float line, int lineType, int lineAnchor, float position, int positionAnchor, float size, boolean windowColorSet, int windowColor, int textSizeType, float textSize, int verticalType, float shearDegrees)
-