public final class WebvttExtractor
extends java.lang.Object
implements com.google.android.exoplayer2.extractor.Extractor
This extractor passes through non-empty WebVTT files untouched, however derives the correct sample timestamp for each by sniffing the X-TIMESTAMP-MAP header along with the start timestamp of the first cue header. Empty WebVTT files are not passed through, since it's not possible to derive a sample timestamp in this case.
| Constructor and Description |
|---|
WebvttExtractor(java.lang.String language,
com.google.android.exoplayer2.util.TimestampAdjuster timestampAdjuster) |
| Modifier and Type | Method and Description |
|---|---|
void |
init(com.google.android.exoplayer2.extractor.ExtractorOutput output) |
int |
read(com.google.android.exoplayer2.extractor.ExtractorInput input,
com.google.android.exoplayer2.extractor.PositionHolder seekPosition) |
void |
release() |
void |
seek(long position,
long timeUs) |
boolean |
sniff(com.google.android.exoplayer2.extractor.ExtractorInput input) |
public WebvttExtractor(java.lang.String language,
com.google.android.exoplayer2.util.TimestampAdjuster timestampAdjuster)
public boolean sniff(com.google.android.exoplayer2.extractor.ExtractorInput input)
throws java.io.IOException,
java.lang.InterruptedException
sniff in interface com.google.android.exoplayer2.extractor.Extractorjava.io.IOExceptionjava.lang.InterruptedExceptionpublic void init(com.google.android.exoplayer2.extractor.ExtractorOutput output)
init in interface com.google.android.exoplayer2.extractor.Extractorpublic void seek(long position,
long timeUs)
seek in interface com.google.android.exoplayer2.extractor.Extractorpublic void release()
release in interface com.google.android.exoplayer2.extractor.Extractorpublic int read(com.google.android.exoplayer2.extractor.ExtractorInput input,
com.google.android.exoplayer2.extractor.PositionHolder seekPosition)
throws java.io.IOException,
java.lang.InterruptedException
read in interface com.google.android.exoplayer2.extractor.Extractorjava.io.IOExceptionjava.lang.InterruptedException