# BundledChunkExtractor

# BundledChunkExtractor

Artifact:[androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3)  
[View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.java+class:androidx.media3.exoplayer.source.chunk.BundledChunkExtractor)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor "View this page in Java")

<br />

```
@UnstableApi
class BundledChunkExtractor : ExtractorOutput, ChunkExtractor
```

<br />

*** ** * ** ***

[ChunkExtractor](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor)implementation that uses ExoPlayer app-bundled[Extractors](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor).

## Summary

|                                                                                                                                                                                                                                                                                    ### Nested types                                                                                                                                                                                                                                                                                    |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[BundledChunkExtractor.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.Factory)` : `[ChunkExtractor.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory) [ChunkExtractor.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.Factory)for[BundledChunkExtractor](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor). |

|                                                                          ### Constants                                                                          |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[BundledChunkExtractor.Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.Factory)`!` | [FACTORY](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#FACTORY()) **This property is deprecated.** [Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.Factory)is mutable, so a static instance is not safe. <br /> |

|                                                                                                                                                                                                                                                                                                                                             ### Public constructors                                                                                                                                                                                                                                                                                                                                              |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [BundledChunkExtractor](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#BundledChunkExtractor(androidx.media3.extractor.Extractor,int,androidx.media3.common.Format))`(` ` extractor: `[Extractor](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor)`!,` ` @`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` primaryTrackType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` primaryTrackManifestFormat: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!` `)` Creates an instance. |

|                                          ### Public functions                                          |
|--------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                          | [endTracks](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#endTracks())`()` Called when all tracks have been identified, meaning no new`trackId`values will be passed to[track](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput#track(int,int)).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [ChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ChunkIndex)`?`   | [getChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#getChunkIndex())`()` Returns the[ChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ChunkIndex)most recently obtained from the chunks, or null if a[ChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ChunkIndex)has not been obtained.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                          | [init](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#init(androidx.media3.exoplayer.source.chunk.ChunkExtractor.TrackOutputProvider,long,long))`(` ` trackOutputProvider: `[ChunkExtractor.TrackOutputProvider](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider)`?,` ` startTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` endTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) `)` Initializes the wrapper to output to[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)s provided by the specified[TrackOutputProvider](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider), and configures the extractor to receive data from a new chunk. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                    | [read](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#read(androidx.media3.extractor.ExtractorInput))`(input: `[ExtractorInput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput)`!)` Reads from the given[ExtractorInput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                          | [release](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#release())`()` Releases any held resources.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                          | [seekMap](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#seekMap(androidx.media3.extractor.SeekMap))`(seekMap: `[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap)`!)` Called when a[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap)has been extracted from the stream.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)`!` | [track](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#track(int,int))`(id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Called by the[Extractor](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor)to get the[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for a specific track.                                                                                                                                                                                                                                                                                                                                                                                                                                   |

|                                                                                                                                          ### Public properties                                                                                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `@`[MonotonicNonNull](https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/MonotonicNonNull.html)` `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!>!` | [sampleFormats](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor#sampleFormats()) |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ### Inherited Constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.extractor.ExtractorOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput) |------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `const `[ExtractorOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput)`!` | [PLACEHOLDER](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput#PLACEHOLDER()) Placeholder[ExtractorOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput)implementation throwing an[UnsupportedOperationException](https://developer.android.com/reference/java/lang/UnsupportedOperationException.html)in each method. | |

## Constants

### FACTORY

```
const val FACTORY: BundledChunkExtractor.Factory!
```
| **This property is deprecated.**   
|
[Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.Factory)is mutable, so a static instance is not safe. Instantiate a new[Factory](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/BundledChunkExtractor.Factory)instead.  

## Public constructors

### BundledChunkExtractor

```
BundledChunkExtractor(
    extractor: Extractor!,
    @C.TrackType primaryTrackType: Int,
    primaryTrackManifestFormat: Format!
)
```

Creates an instance.  

|                                                                                             Parameters                                                                                              |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `extractor: `[Extractor](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor)`!`                                                                                     | The extractor to wrap.                                                                                                                                                                                                                                                                                                                                                        |
| `@`[C.TrackType](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)` primaryTrackType: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[type](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType)of the primary track.                                                                                                                                                                                                                                                             |
| `primaryTrackManifestFormat: `[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)`!`                                                                             | A manifest defined[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)whose data should be merged into any sample[Format](https://developer.android.com/reference/kotlin/androidx/media3/common/Format)output from the[Extractor](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor)for the primary track. |

## Public functions

### endTracks

```
fun endTracks(): Unit
```

Called when all tracks have been identified, meaning no new`trackId`values will be passed to[track](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorOutput#track(int,int)).  

### getChunkIndex

```
fun getChunkIndex(): ChunkIndex?
```

Returns the[ChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ChunkIndex)most recently obtained from the chunks, or null if a[ChunkIndex](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ChunkIndex)has not been obtained.  

### init

```
fun init(
    trackOutputProvider: ChunkExtractor.TrackOutputProvider?,
    startTimeUs: Long,
    endTimeUs: Long
): Unit
```

Initializes the wrapper to output to[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)s provided by the specified[TrackOutputProvider](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider), and configures the extractor to receive data from a new chunk.  

|                                                                                        Parameters                                                                                        |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `trackOutputProvider: `[ChunkExtractor.TrackOutputProvider](https://developer.android.com/reference/kotlin/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider)`?` | The provider of[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)s that will receive sample data.                                      |
| `startTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                             | The start position in the new chunk, or[TIME_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET())to output samples from the start of the chunk. |
| `endTimeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                                               | The end position in the new chunk, or[TIME_UNSET](https://developer.android.com/reference/kotlin/androidx/media3/common/C#TIME_UNSET())to output samples to the end of the chunk.       |

### read

```
fun read(input: ExtractorInput!): Boolean
```

Reads from the given[ExtractorInput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput).  

|                                                      Parameters                                                       |
|-----------------------------------------------------------------------------------------------------------------------|-------------------------|
| `input: `[ExtractorInput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/ExtractorInput)`!` | The input to read from. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether there is any data left to extract. Returns false if the end of input has been reached. |

|                                         Throws                                          |
|-----------------------------------------------------------------------------------------|---------------------------------------------------------|
| [java.io.IOException](https://developer.android.com/reference/java/io/IOException.html) | If an error occurred reading from or parsing the input. |

### release

```
fun release(): Unit
```

Releases any held resources.  

### seekMap

```
fun seekMap(seekMap: SeekMap!): Unit
```

Called when a[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap)has been extracted from the stream.  

|                                                Parameters                                                 |
|-----------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|
| `seekMap: `[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap)`!` | The extracted[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap). |

### track

```
fun track(id: Int, type: Int): TrackOutput!
```

Called by the[Extractor](https://developer.android.com/reference/kotlin/androidx/media3/extractor/Extractor)to get the[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for a specific track.

The same[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)is returned if multiple calls are made with the same`
id`.  

|                                     Parameters                                      |
|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| `id: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | A track identifier.                                                                                 |
| `type: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The[track type](https://developer.android.com/reference/kotlin/androidx/media3/common/C.TrackType). |

|                                                Returns                                                 |
|--------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| [TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)`!` | The[TrackOutput](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackOutput)for the given track identifier. |

## Public properties

### sampleFormats

```
val sampleFormats: @MonotonicNonNull Array<Format!>!
```