BundledExtractorsAdapter
@UnstableApi
public final class BundledExtractorsAdapter implements ProgressiveMediaExtractor
ProgressiveMediaExtractor built on top of Extractor instances, whose implementation classes are bundled in the app.
Summary
Public constructors |
|---|
BundledExtractorsAdapter(ExtractorsFactory extractorsFactory)Creates a holder that will select an extractor and initialize it using the specified output. |
Public methods |
|
|---|---|
void |
Disables seeking in MP3 streams. |
long |
Returns the current read position in the input stream, or |
void |
init(Initializes the underlying infrastructure for reading from the input. |
int |
read(PositionHolder positionHolder)Extracts data starting at the current input stream position. |
void |
release()Releases any held resources. |
void |
seek(long position, long seekTimeUs)Notifies the extracting infrastructure that a seek has occurred. |
Public constructors
BundledExtractorsAdapter
public BundledExtractorsAdapter(ExtractorsFactory extractorsFactory)
Creates a holder that will select an extractor and initialize it using the specified output.
| Parameters | |
|---|---|
ExtractorsFactory extractorsFactory |
The |
Public methods
disableSeekingOnMp3Streams
public void disableSeekingOnMp3Streams()
Disables seeking in MP3 streams.
MP3 live streams commonly have seekable metadata, despite being unseekable.
getCurrentInputPosition
public long getCurrentInputPosition()
Returns the current read position in the input stream, or INDEX_UNSET if no input is available.
init
public void init(
DataReader dataReader,
Uri uri,
Map<String, List<String>> responseHeaders,
long position,
long length,
ExtractorOutput output
)
Initializes the underlying infrastructure for reading from the input.
| Parameters | |
|---|---|
DataReader dataReader |
The |
Uri uri |
The |
Map<String, List<String>> responseHeaders |
The response headers of the media, or an empty map if there are none. |
long position |
The initial position of the |
long length |
The length of the stream, or |
ExtractorOutput output |
The |
| Throws | |
|---|---|
androidx.media3.exoplayer.source.UnrecognizedInputFormatException |
Thrown if the input format could not be detected. |
java.io.IOException |
Thrown if the input could not be read. |
read
public int read(PositionHolder positionHolder)
Extracts data starting at the current input stream position.
| Parameters | |
|---|---|
PositionHolder positionHolder |
If |
| Returns | |
|---|---|
int |
One of the |
| Throws | |
|---|---|
java.io.IOException |
If an error occurred reading from the input. |
seek
public void seek(long position, long seekTimeUs)
Notifies the extracting infrastructure that a seek has occurred.
| Parameters | |
|---|---|
long position |
The byte offset in the stream from which data will be provided. |
long seekTimeUs |
The seek time in microseconds. |