Class CaptionText


  • public class CaptionText
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ANCHOR_TYPE_END
      Anchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box.
      static int ANCHOR_TYPE_MIDDLE
      Anchors the middle of the cue box.
      static int ANCHOR_TYPE_START
      Anchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box.
      static float DIMEN_UNSET
      An unset position, width or size.
      float line
      The position of the cue box within the viewport in the direction orthogonal to the writing direction (determined by verticalType), or DIMEN_UNSET.
      static int LINE_TYPE_FRACTION
      Value for lineType when line is a fractional position.
      static int LINE_TYPE_NUMBER
      Value for lineType when line is a line number.
      @com.jwplayer.pub.api.media.captions.CaptionText.AnchorType int lineAnchor
      The cue box anchor positioned by line when lineType is LINE_TYPE_FRACTION.
      @com.jwplayer.pub.api.media.captions.CaptionText.LineType int lineType
      The type of the line value.
      android.text.Layout.Alignment multiRowAlignment
      The alignment of multiple lines of text relative to the longest line, or null if the alignment is undefined.
      float position
      The fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line, or DIMEN_UNSET.
      @com.jwplayer.pub.api.media.captions.CaptionText.AnchorType int positionAnchor
      The cue box anchor positioned by position.
      float shearDegrees
      The shear angle in degrees to be applied to this CaptionText, expressed in graphics coordinates.
      float size
      The size of the cue box in the writing direction specified as a fraction of the viewport size in that direction, or DIMEN_UNSET.
      java.lang.CharSequence text
      The cue text, or null if this is an image cue.
      static int TEXT_SIZE_TYPE_ABSOLUTE
      Text size is measured in number of pixels.
      static int TEXT_SIZE_TYPE_FRACTIONAL
      Text size is measured as a fraction of the viewport size minus the view padding.
      static int TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING
      Text size is measured as a fraction of the viewport size, ignoring the view padding
      android.text.Layout.Alignment textAlignment
      The alignment of the cue text within the cue box, or null if the alignment is undefined.
      float textSize
      The default text size for this cue's text, or DIMEN_UNSET if this cue has no default text size.
      @com.jwplayer.pub.api.media.captions.CaptionText.TextSizeType int textSizeType
      The default text size type for this cue's text, or TYPE_UNSET if this cue has no default text size.
      static int TYPE_UNSET
      An unset anchor, line, text size or vertical type value.
      static int VERTICAL_TYPE_LR
      Vertical left-to-right (e.g.
      static int VERTICAL_TYPE_RL
      Vertical right-to-left (e.g.
      @com.jwplayer.pub.api.media.captions.CaptionText.VerticalType int verticalType
      The vertical formatting of this CaptionText, or TYPE_UNSET if the cue has no vertical setting (and so should be horizontal).
      int windowColor
      The fill color of the window.
      boolean windowColorSet
      Specifies whether or not the windowColor property is set.
    • Constructor Summary

      Constructors 
      Constructor Description
      CaptionText​(java.lang.CharSequence text, android.text.Layout.Alignment textAlignment, android.text.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

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DIMEN_UNSET

        public static final float DIMEN_UNSET
        An unset position, width or size.
        See Also:
        Constant Field Values
      • TYPE_UNSET

        public static final int TYPE_UNSET
        An unset anchor, line, text size or vertical type value.
        See Also:
        Constant Field Values
      • ANCHOR_TYPE_START

        public static final int ANCHOR_TYPE_START
        Anchors the left (for horizontal positions) or top (for vertical positions) edge of the cue box.
        See Also:
        Constant Field Values
      • ANCHOR_TYPE_MIDDLE

        public static final int ANCHOR_TYPE_MIDDLE
        Anchors the middle of the cue box.
        See Also:
        Constant Field Values
      • ANCHOR_TYPE_END

        public static final int ANCHOR_TYPE_END
        Anchors the right (for horizontal positions) or bottom (for vertical positions) edge of the cue box.
        See Also:
        Constant Field Values
      • TEXT_SIZE_TYPE_FRACTIONAL

        public static final int TEXT_SIZE_TYPE_FRACTIONAL
        Text size is measured as a fraction of the viewport size minus the view padding.
        See Also:
        Constant Field Values
      • TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING

        public static final int TEXT_SIZE_TYPE_FRACTIONAL_IGNORE_PADDING
        Text size is measured as a fraction of the viewport size, ignoring the view padding
        See Also:
        Constant Field Values
      • TEXT_SIZE_TYPE_ABSOLUTE

        public static final int TEXT_SIZE_TYPE_ABSOLUTE
        Text size is measured in number of pixels.
        See Also:
        Constant Field Values
      • VERTICAL_TYPE_RL

        public static final int VERTICAL_TYPE_RL
        Vertical right-to-left (e.g. for Japanese).
        See Also:
        Constant Field Values
      • VERTICAL_TYPE_LR

        public static final int VERTICAL_TYPE_LR
        Vertical left-to-right (e.g. for Mongolian).
        See Also:
        Constant Field Values
      • text

        @Nullable
        public final java.lang.CharSequence text
        The cue text, or null if this is an image cue. Note the CharSequence may be decorated with styling spans.
      • textAlignment

        @Nullable
        public final android.text.Layout.Alignment textAlignment
        The alignment of the cue text within the cue box, or null if the alignment is undefined.
      • multiRowAlignment

        @Nullable
        public final android.text.Layout.Alignment multiRowAlignment
        The alignment of multiple lines of text relative to the longest line, or null if the alignment is undefined.
      • line

        public final float line
        The position of the cue box within the viewport in the direction orthogonal to the writing direction (determined by verticalType), or DIMEN_UNSET. When set, the interpretation of the value depends on the value of lineType.

        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_LR this is the horizontal position relative to the left of the viewport.
        • For VERTICAL_TYPE_RL this is the horizontal position relative to the right of the viewport.
      • lineType

        @LineType
        public final @com.jwplayer.pub.api.media.captions.CaptionText.LineType int lineType
        The type of the line value.
        • LINE_TYPE_FRACTION indicates that line is a fractional position within the viewport (measured to the part of the cue box determined by lineAnchor).
        • LINE_TYPE_NUMBER indicates that line is 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 line is 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 line is 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.
      • position

        public final float position
        The fractional position of the positionAnchor of the cue box within the viewport in the direction orthogonal to line, or DIMEN_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_LR and VERTICAL_TYPE_RL (i.e. vertical), this is the vertical position relative to the top of the viewport.
      • size

        public final float size
        The size of the cue box in the writing direction specified as a fraction of the viewport size in that direction, or DIMEN_UNSET.
      • windowColorSet

        public final boolean windowColorSet
        Specifies whether or not the windowColor property is set.
      • windowColor

        public final int windowColor
        The fill color of the window.
      • textSizeType

        @TextSizeType
        public final @com.jwplayer.pub.api.media.captions.CaptionText.TextSizeType int textSizeType
        The default text size type for this cue's text, or TYPE_UNSET if this cue has no default text size.
      • textSize

        public final float textSize
        The default text size for this cue's text, or DIMEN_UNSET if this cue has no default text size.
      • verticalType

        @VerticalType
        public final @com.jwplayer.pub.api.media.captions.CaptionText.VerticalType int verticalType
        The vertical formatting of this CaptionText, or TYPE_UNSET if the cue has no vertical setting (and so should be horizontal).
      • shearDegrees

        public final float shearDegrees
        The 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 Detail

      • CaptionText

        public CaptionText​(@Nullable
                           java.lang.CharSequence text,
                           @Nullable
                           android.text.Layout.Alignment textAlignment,
                           @Nullable
                           android.text.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)