Class Caption
- java.lang.Object
-
- com.longtailvideo.jwplayer.media.captions.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Caption.Builder
Builder forCaption
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.List<Caption>
cloneList(java.util.List<Caption> src)
boolean
equals(java.lang.Object obj)
java.lang.String
getFile()
CaptionType
getKind()
java.lang.String
getLabel()
int
hashCode()
boolean
isDefault()
static java.util.List<Caption>
listFromJson(java.lang.String json)
static java.util.List<Caption>
listFromJson(org.json.JSONArray json)
static Caption
parseJson(java.lang.String json)
static Caption
parseJson(org.json.JSONObject json)
void
setDefault(boolean _default)
void
setFile(java.lang.String file)
void
setKind(CaptionType kind)
void
setLabel(java.lang.String label)
org.json.JSONObject
toJson()
-
-
-
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)
-
toJson
public org.json.JSONObject toJson()
- Specified by:
toJson
in interfacecom.longtailvideo.jwplayer.utils.Jsonable
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-