Class Caption

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

    public class Caption
    extends java.lang.Object
    implements com.longtailvideo.jwplayer.utils.Jsonable
    A caption track.
    • Constructor Detail

      • Caption

        public Caption​(java.lang.String file)
      • Caption

        public Caption​(java.lang.String file,
                       CaptionType kind,
                       java.lang.String label,
                       java.lang.Boolean defaultTrack)
      • Caption

        public Caption()
      • Caption

        public Caption​(Caption source)
        Copy constructor.
        Parameters:
        source - Caption object to copy.
    • Method Detail

      • getFile

        @Nullable
        public java.lang.String getFile()
        Returns:
        URL to the captions, chapters or thumbnails text track file.
      • getKind

        @NonNull
        public CaptionType getKind()
        Returns:
        The kind of text track.
      • getLabel

        @Nullable
        public java.lang.String getLabel()
        Returns:
        Label of the text track. Is only used in setups with multiple captions, where the label is displayed in the CC selection menu.
      • isDefault

        public boolean isDefault()
        Returns:
        Only for captions. Set this to true if you want a captions track to display by default
      • setFile

        public void setFile​(java.lang.String file)
        Parameters:
        file - URL to the captions, chapters or thumbnails text track file.
      • setKind

        public void setKind​(CaptionType kind)
        Parameters:
        kind - The kind of text track.
      • setLabel

        public void setLabel​(java.lang.String label)
        Parameters:
        label - Label of the text track. Is only used in setups with multiple captions, where the label is displayed in the CC selection menu.
      • setDefault

        public void setDefault​(boolean _default)
        Parameters:
        _default - Only for captions. Set this to true if you want a captions track to display by default
      • parseJson

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

        public static Caption parseJson​(java.lang.String json)
                                 throws org.json.JSONException
        Throws:
        org.json.JSONException
      • listFromJson

        public static java.util.List<Caption> listFromJson​(org.json.JSONArray json)
      • listFromJson

        public static java.util.List<Caption> listFromJson​(java.lang.String json)
      • cloneList

        public static java.util.List<Caption> cloneList​(java.util.List<Caption> src)
      • toJson

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

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object