Package com.snowbound.common.transport
Class MediaCaption
- java.lang.Object
-
- com.snowbound.common.transport.MediaCaption
-
- All Implemented Interfaces:
java.io.Serializable
public class MediaCaption extends java.lang.Object implements java.io.Serializable
Represents a media caption (and its metadata) for a video or audio document. The source file must be in .vtt (Video Text Tracks) format.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MediaCaption.Kind
-
Constructor Summary
Constructors Constructor Description MediaCaption(java.lang.String label, byte[] file)
Creates a caption object with the provided label and .vtt data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getFile()
MediaCaption.Kind
getKind()
java.lang.String
getLabel()
java.lang.String
getLanguageTag()
void
setFile(byte[] file)
void
setKind(MediaCaption.Kind kind)
Allows setting the type of this text track.void
setLabel(java.lang.String label)
void
setLanguageTag(java.lang.String languageTag)
Set the language of this text track, as a BCP-47 language tag.org.json.JSONObject
toJSON()
-
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
-
setLabel
public void setLabel(java.lang.String label)
-
getFile
public byte[] getFile()
-
setFile
public void setFile(byte[] file)
-
getKind
public MediaCaption.Kind getKind()
-
setKind
public void setKind(MediaCaption.Kind kind)
Allows setting the type of this text track. By default the kind is "captions" - a transcription and possibly translation of audio. The other available kinds are "descriptions" - a textual description of the video content for the sight-impaired - and "subtitles" - translations of content for the viewer, such as when a character in an English-language film speaks in another language. Two additional uncommon types are "chapters", denoting different parts of the media in text for navigation, and "metadata", non-user-visible text cues that can be used by client scripts. The default kind of "captions" should be kept for most cases, unless the .vtt is known to be of another kind.
-
getLanguageTag
public java.lang.String getLanguageTag()
-
setLanguageTag
public void setLanguageTag(java.lang.String languageTag)
Set the language of this text track, as a BCP-47 language tag. This is only required if the kind is set to "subtitles".
-
toJSON
public org.json.JSONObject toJSON()
-
-