Class CaptionsConfig

  • All Implemented Interfaces:
    com.longtailvideo.jwplayer.utils.Jsonable

    public class CaptionsConfig
    extends java.lang.Object
    implements com.longtailvideo.jwplayer.utils.Jsonable
    Captions configuration used to set up the player. Contains options for styling captions.
    • Field Detail

      • CAPTION_EDGE_STYLE_NONE

        public static final java.lang.String CAPTION_EDGE_STYLE_NONE
        Edge type value specifying no character edges.
        See Also:
        Constant Field Values
      • CAPTION_EDGE_STYLE_DROP_SHADOW

        public static final java.lang.String CAPTION_EDGE_STYLE_DROP_SHADOW
        Edge type value specifying drop-shadowed character edges.
        See Also:
        Constant Field Values
      • CAPTION_EDGE_STYLE_RAISED

        public static final java.lang.String CAPTION_EDGE_STYLE_RAISED
        Edge type value specifying raised bevel character edges.
        See Also:
        Constant Field Values
      • CAPTION_EDGE_STYLE_DEPRESSED

        public static final java.lang.String CAPTION_EDGE_STYLE_DEPRESSED
        Edge type value specifying depressed bevel character edges.
        See Also:
        Constant Field Values
      • CAPTION_EDGE_STYLE_UNIFORM

        public static final java.lang.String CAPTION_EDGE_STYLE_UNIFORM
        Edge type value specifying uniformly outlined character edges.
        See Also:
        Constant Field Values
      • CAPTION_DEFAULT_FONT_SIZE

        public static final int CAPTION_DEFAULT_FONT_SIZE
        Default caption font size in pixels.
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • setColor

        public void setColor​(java.lang.String color)
        Parameters:
        color - Hex color of the captions text.
      • setFontSize

        public void setFontSize​(java.lang.Integer fontSize)
        Parameters:
        fontSize - Size of the captions text (Will not affect text size when rendering captions via browser).
      • setFontFamily

        public void setFontFamily​(java.lang.String fontFamily)
        Parameters:
        fontFamily - Font Family of the captions text.
        See Also:
        Font Families
      • setFontOpacity

        public void setFontOpacity​(java.lang.Integer fontOpacity)
        Parameters:
        fontOpacity - Alpha percentage of the captions text.
      • setBackgroundColor

        public void setBackgroundColor​(java.lang.String backgroundColor)
        Parameters:
        backgroundColor - Hex color of the caption characters background.
      • setBackgroundOpacity

        public void setBackgroundOpacity​(java.lang.Integer backgroundOpacity)
        Parameters:
        backgroundOpacity - Alpha percentage of the caption characters background.
      • setEdgeStyle

        public void setEdgeStyle​(java.lang.String edgeStyle)
        Parameters:
        edgeStyle - Method by which the captions characters are separated from their background, must be one of the CAPTION_EDGE_STYLE_ constants.
      • setWindowColor

        public void setWindowColor​(java.lang.String windowColor)
        Parameters:
        windowColor - Hex color of the background of the entire captions area.
      • setWindowOpacity

        public void setWindowOpacity​(java.lang.Integer windowOpacity)
        Parameters:
        windowOpacity - Alpha percentage of the background of the entire captions area.
      • getColor

        @NonNull
        public java.lang.String getColor()
        Returns:
        Hex color of the captions text.
      • getFontSize

        public int getFontSize()
        Returns:
        Size of the captions text (Will not affect text size when rendering captions via browser).
      • getFontFamily

        @NonNull
        public java.lang.String getFontFamily()
        Returns:
        Font Family of the captions text.
        See Also:
        Font Families
      • getFontOpacity

        public int getFontOpacity()
        Returns:
        Alpha percentage of the captions text.
      • getBackgroundColor

        @NonNull
        public java.lang.String getBackgroundColor()
        Returns:
        Hex color of the caption characters background.
      • getBackgroundOpacity

        public int getBackgroundOpacity()
        Returns:
        Alpha percentage of the caption characters background.
      • getEdgeStyle

        @NonNull
        public java.lang.String getEdgeStyle()
        Returns:
        Method by which the captions characters are separated from their background, must be one of the CAPTION_EDGE_STYLE_ constants.
      • getWindowColor

        @NonNull
        public java.lang.String getWindowColor()
        Returns:
        Hex color of the background of the entire captions area.
      • getWindowOpacity

        public int getWindowOpacity()
        Returns:
        Alpha percentage of the background of the entire captions area.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toJson

        public org.json.JSONObject toJson()
        Specified by:
        toJson in interface com.longtailvideo.jwplayer.utils.Jsonable
      • parseJson

        public static CaptionsConfig parseJson​(org.json.JSONObject json)
                                        throws org.json.JSONException
        Throws:
        org.json.JSONException
      • parseJson

        public static CaptionsConfig parseJson​(java.lang.String jsonStr)