-
Method Summary
Modifier and TypeMethodDescriptionlongdelay()Get the sub-title delay.voidsetDelay(long delay) Set the sub-title delay.booleansetSubTitleFile(File subTitleFile) Set the sub-title file to use.booleansetSubTitleFile(String subTitleFileName) Set the sub-title file to use.booleansetSubTitleUri(String uri) Set sub-titles from a URI.intsetTrack(int spu) Set the current sub-title track.inttrack()Get the current sub-title track.intGet the number of sub-pictures/sub-title tracks.Get the sub-title track descriptions.
-
Method Details
-
trackCount
public int trackCount()Get the number of sub-pictures/sub-title tracks.- Returns:
- number of sub-title tracks
-
track
public int track()Get the current sub-title track.- Returns:
- sub-title number, or -1 if none
-
setTrack
public int setTrack(int spu) Set the current sub-title track.The track identifier must be one of those returned by
trackDescriptions().Subtitles can be disabled by passing here the identifier of the track with a description of "Disable".
There is no guarantee that the available subtitle identifiers go in sequence from zero up to
trackCount()-1. ThetrackDescriptions()method should always be used to ascertain the available subtitle identifiers.The implementation of the corresponding native method in libvlc is bugged before vlc 2.0.6, therefore vlc 2.0.6 or later is required for correct behaviour when using this method.
- Parameters:
spu- sub-title identifier, or -1 for none- Returns:
- current sub-title identifier
-
delay
public long delay()Get the sub-title delay.- Returns:
- sub-title delay, in microseconds
-
setDelay
public void setDelay(long delay) Set the sub-title delay.The sub-title delay is set for the current item only and will be reset to zero each time the media changes.
- Parameters:
delay- desired sub-title delay, in microseconds
-
setSubTitleFile
Set the sub-title file to use.These sub-titles will be automatically selected.
This method is a convenience for
MediaApi.addSlave(MediaSlaveType, String, boolean).- Parameters:
subTitleFileName- name of the local file containing the sub-titles- Returns:
trueif successful;falseon error
-
setSubTitleFile
Set the sub-title file to use.These sub-titles will be automatically selected.
This method is a convenience for
MediaApi.addSlave(MediaSlaveType, String, boolean).- Parameters:
subTitleFile- file containing the sub-titles- Returns:
trueif successful;falseon error
-
setSubTitleUri
Set sub-titles from a URI.These sub-titles will be automatically selected.
This method is a convenience for
MediaApi.addSlave(MediaSlaveType, String, boolean).See
SlaveApi.add(MediaSlaveType, MediaSlavePriority, String)for further important information regarding this method.- Parameters:
uri- sub-title URI- Returns:
trueif successful;falseon error
-
trackDescriptions
Get the sub-title track descriptions.The media must be playing before this information is available.
- Returns:
- list of descriptions, may be empty but will never be
null
-