Package org.opencastproject.caption.util
Class TimeUtil
java.lang.Object
org.opencastproject.caption.util.TimeUtil
Auxiliary class that contains methods for converting from and to specific time formats.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringexportToDFXP(Time time) ExportsTimeinstance to the DFXP time format representation.static StringexportToSrt(Time time) ExportsTimeinstance to the SubRip time format representation.static StringexportToVtt(Time time) ExportsTimeinstance to the WebVTT time format representation.static TimeimportDFXP(String timeDfxp) Parse String representation of DFXP time format.static TimeParse String representation of SubRip time format.
-
Method Details
-
importSrt
Parse String representation of SubRip time format.- Parameters:
timeSrt- SubRip time format- Returns:
- parsed
Timeinstance - Throws:
IllegalTimeFormatException- if argument is not SubRip time format
-
exportToSrt
ExportsTimeinstance to the SubRip time format representation.- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to SubRip time format
-
exportToVtt
ExportsTimeinstance to the WebVTT time format representation.- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to WebVTT time format
-
importDFXP
Parse String representation of DFXP time format. It does not support parsing of metrics (for example: 34.567s).- Parameters:
timeDfxp- DFXP time format- Returns:
- parsed
Timeinstance - Throws:
IllegalTimeFormatException- if argument is not DFXP time format or is not supported.
-
exportToDFXP
ExportsTimeinstance to the DFXP time format representation. Specifically time format used is 0:00:00.000- Parameters:
time-Timeinstance to be exported- Returns:
- time exported to DFXP time format
-