Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/media/MediaParser#nestedclasses) \| [Constants](https://developer.android.com/reference/android/media/MediaParser#constants) \| [Methods](https://developer.android.com/reference/android/media/MediaParser#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/media/MediaParser#inhmethods)

# MediaParser

*** ** * ** ***


`
public

final

class
MediaParser
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.media.MediaParser |

<br />

*** ** * ** ***

Parses media container formats and extracts contained media samples and metadata.

This class provides access to a battery of low-level media container parsers. Each instance of
this class is associated to a specific media parser implementation which is suitable for
extraction from a specific media container format. The media parser implementation assignment
depends on the factory method (see `https://developer.android.com/reference/android/media/MediaParser#create(android.media.MediaParser.OutputConsumer,%20java.lang.String[])` and `https://developer.android.com/reference/android/media/MediaParser#createByName(java.lang.String,%20android.media.MediaParser.OutputConsumer)`) used to create the
instance.

Users must implement the following to use this class.

- `https://developer.android.com/reference/android/media/MediaParser.InputReader`: Provides the media container's bytes to parse.
- `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer`: Provides a sink for all extracted data and metadata.

The following code snippet includes a usage example:

```
 MyOutputConsumer myOutputConsumer = new MyOutputConsumer();
 MyInputReader myInputReader = new MyInputReader("www.example.com");
 MediaParser mediaParser = MediaParser.create(myOutputConsumer);

 while (mediaParser.advance(myInputReader)) {}

 mediaParser.release();
 mediaParser = null;
 
```

The following code snippet provides a rudimentary `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer` sample implementation
which extracts and publishes all video samples:

```
 class VideoOutputConsumer implements MediaParser.OutputConsumer {

     private byte[] sampleDataBuffer = new byte[4096];
     private byte[] discardedDataBuffer = new byte[4096];
     private int videoTrackIndex = -1;
     private int bytesWrittenCount = 0;

     @Override
     public void onSeekMapFound(int i, @NonNull SeekMap seekMap) {
       // Do nothing.
     }

     @Override
     public void onTrackDataFound(int i, @NonNull TrackData trackData) {
       MediaFormat mediaFormat = trackData.mediaFormat;
       if (videoTrackIndex == -1 &&
           mediaFormat
               .getString(MediaFormat.KEY_MIME, /* defaultValue= */ "")
               .startsWith("video/")) {
         videoTrackIndex = i;
       }
     }

     @Override
     public void onSampleDataFound(int trackIndex, @NonNull InputReader inputReader)
         throws IOException {
       int numberOfBytesToRead = (int) inputReader.getLength();
       if (videoTrackIndex != trackIndex) {
         // Discard contents.
         inputReader.read(
             discardedDataBuffer,
             /* offset= */ 0,
             Math.min(discardDataBuffer.length, numberOfBytesToRead));
       } else {
         ensureSpaceInBuffer(numberOfBytesToRead);
         int bytesRead = inputReader.read(
             sampleDataBuffer, bytesWrittenCount, numberOfBytesToRead);
         bytesWrittenCount += bytesRead;
       }
     }

     @Override
     public void onSampleCompleted(
         int trackIndex,
         long timeMicros,
         int flags,
         int size,
         int offset,
         @Nullable CryptoInfo cryptoData) {
       if (videoTrackIndex != trackIndex) {
         return; // It's not the video track. Ignore.
       }
       byte[] sampleData = new byte[size];
       int sampleStartOffset = bytesWrittenCount - size - offset;
       System.arraycopy(
           sampleDataBuffer,
           sampleStartOffset,
           sampleData,
           /* destPos= */ 0,
           size);
       // Place trailing bytes at the start of the buffer.
       System.arraycopy(
           sampleDataBuffer,
           bytesWrittenCount - offset,
           sampleDataBuffer,
           /* destPos= */ 0,
           /* size= */ offset);
       bytesWrittenCount = bytesWrittenCount - offset;
       publishSample(sampleData, timeMicros, flags);
     }

    private void ensureSpaceInBuffer(int numberOfBytesToRead) {
      int requiredLength = bytesWrittenCount + numberOfBytesToRead;
      if (requiredLength > sampleDataBuffer.length) {
        sampleDataBuffer = Arrays.copyOf(sampleDataBuffer, requiredLength);
      }
    }

   }

 
```

<br />

## Summary

| ### Nested classes ||
|---|---|
| ` interface` | `https://developer.android.com/reference/android/media/MediaParser.InputReader` Provides input data to `https://developer.android.com/reference/android/media/MediaParser`. |
| ` interface` | `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer` Receives extracted media sample data and metadata from `https://developer.android.com/reference/android/media/MediaParser`. |
| ` class` | `https://developer.android.com/reference/android/media/MediaParser.ParsingException` Thrown when an error occurs while parsing a media stream. |
| ` class` | `https://developer.android.com/reference/android/media/MediaParser.SeekMap` Maps seek positions to `https://developer.android.com/reference/android/media/MediaParser.SeekPoint` in the stream. |
| ` class` | `https://developer.android.com/reference/android/media/MediaParser.SeekPoint` Defines a seek point in a media stream. |
| ` interface` | `https://developer.android.com/reference/android/media/MediaParser.SeekableInputReader` `https://developer.android.com/reference/android/media/MediaParser.InputReader` that allows setting the read position. |
| ` class` | `https://developer.android.com/reference/android/media/MediaParser.TrackData` Holds information associated with a track. |
| ` class` | `https://developer.android.com/reference/android/media/MediaParser.UnrecognizedInputFormatException` Thrown if all parser implementations provided to `https://developer.android.com/reference/android/media/MediaParser#create(android.media.MediaParser.OutputConsumer,%20java.lang.String[])` failed to sniff the input content. |

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_ADTS_ENABLE_CBR_SEEKING` Sets whether constant bitrate seeking should be enabled for ADTS parsing. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_AMR_ENABLE_CBR_SEEKING` Sets whether constant bitrate seeking should be enabled for AMR. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_FLAC_DISABLE_ID3` Sets whether the ID3 track should be disabled for FLAC. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MATROSKA_DISABLE_CUES_SEEKING` Sets whether Matroska parsing should avoid seeking to the cues element. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_DISABLE_ID3` Sets whether the ID3 track should be disabled for MP3. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_CBR_SEEKING` Sets whether constant bitrate seeking should be enabled for MP3. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_INDEX_SEEKING` Sets whether MP3 parsing should generate a time-to-byte mapping. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_EDIT_LISTS` Sets whether MP4 parsing should ignore edit lists. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_TFDT_BOX` Sets whether MP4 parsing should ignore the tfdt box. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES` Sets whether MP4 parsing should treat all video frames as key frames. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES` Sets whether TS should treat samples consisting of non-IDR I slices as synchronization samples (key-frames). |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_DETECT_ACCESS_UNITS` Sets whether TS parsing should split AVC stream into access units based on slice headers. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS` Sets whether TS parsing should handle HDMV DTS audio streams. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AAC_STREAM` Sets whether TS parsing should ignore AAC elementary streams. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AVC_STREAM` Sets whether TS parsing should ignore AVC elementary streams. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM` Sets whether TS parsing should ignore splice information streams. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_MODE` Sets the operation mode for TS parsing. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC3` Parser for the AC-3 container format, as defined in Digital Audio Compression Standard (AC-3). |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC4` Parser for the AC-4 container format, as defined by Dolby AC-4: Audio delivery for Next-Generation Entertainment Services. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_ADTS` Parser for the ADTS container format, as defined in ISO/IEC 13818-7. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AMR` Parser for the AMR container format, as defined in RFC 4867. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLAC` Parser for the FLAC container format, as defined in the [spec](https://xiph.org/flac/). |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLV` Parser for the FLV container format, as defined in Adobe Flash Video File Format Specification. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FMP4` Parser for fragmented files using the MP4 container format, as defined in ISO/IEC 14496-12. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MATROSKA` Parser for the Matroska container format, as defined in the [spec](https://matroska.org/technical/specs/). |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP3` Parser for the MP3 container format, as defined in ISO/IEC 11172-3. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP4` Parser for non-fragmented files using the MP4 container format, as defined in ISO/IEC 14496-12. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_OGG` Parser for the OGG container format, as defined in RFC 3533. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_PS` Parser for the PS container format, as defined in ISO/IEC 11172-1. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_TS` Parser for the TS container format, as defined in ISO/IEC 13818-1. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` Parser name returned by `https://developer.android.com/reference/android/media/MediaParser#getParserName()` when no parser has been selected yet. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_WAV` Parser for the WAV container format, as defined in Multimedia Programming Interface and Data Specifications. |
| `int` | `https://developer.android.com/reference/android/media/MediaParser#SAMPLE_FLAG_DECODE_ONLY` *This constant was deprecated in API level 37.1. This flag is no longer supported and will be ignored.* |
| `int` | `https://developer.android.com/reference/android/media/MediaParser#SAMPLE_FLAG_ENCRYPTED` Indicates that the sample is (at least partially) encrypted. |
| `int` | `https://developer.android.com/reference/android/media/MediaParser#SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA` Indicates that the sample has supplemental data. |
| `int` | `https://developer.android.com/reference/android/media/MediaParser#SAMPLE_FLAG_KEY_FRAME` Indicates that the sample holds a synchronization sample. |
| `int` | `https://developer.android.com/reference/android/media/MediaParser#SAMPLE_FLAG_LAST_SAMPLE` Indicates that the sample is known to contain the last media sample of the stream. |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)(https://developer.android.com/reference/android/media/MediaParser.SeekableInputReader seekableInputReader) ` Makes progress in the extraction of the input media stream, unless the end of the input has been reached. |
| ` static https://developer.android.com/reference/android/media/MediaParser` | ` https://developer.android.com/reference/android/media/MediaParser#create(android.media.MediaParser.OutputConsumer,%20java.lang.String[])(https://developer.android.com/reference/android/media/MediaParser.OutputConsumer outputConsumer, https://developer.android.com/reference/java/lang/String parserNames) ` Creates an instance whose backing parser will be selected by sniffing the content during the first `https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)` call. |
| ` static https://developer.android.com/reference/android/media/MediaParser` | ` https://developer.android.com/reference/android/media/MediaParser#createByName(java.lang.String,%20android.media.MediaParser.OutputConsumer)(https://developer.android.com/reference/java/lang/String name, https://developer.android.com/reference/android/media/MediaParser.OutputConsumer outputConsumer) ` Creates an instance backed by the parser with the given `name`. |
| ` https://developer.android.com/reference/android/media/metrics/LogSessionId` | ` https://developer.android.com/reference/android/media/MediaParser#getLogSessionId()() ` |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/media/MediaParser#getParserName()() ` Returns the name of the backing parser implementation. |
| ` static https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | ` https://developer.android.com/reference/android/media/MediaParser#getParserNames(android.media.MediaFormat)(https://developer.android.com/reference/android/media/MediaFormat mediaFormat) ` Returns an immutable list with the names of the parsers that are suitable for container formats with the given `https://developer.android.com/reference/android/media/MediaFormat`. |
| ` void` | ` https://developer.android.com/reference/android/media/MediaParser#release()() ` Releases any acquired resources. |
| ` void` | ` https://developer.android.com/reference/android/media/MediaParser#seek(android.media.MediaParser.SeekPoint)(https://developer.android.com/reference/android/media/MediaParser.SeekPoint seekPoint) ` Seeks within the media container being extracted. |
| ` void` | ` https://developer.android.com/reference/android/media/MediaParser#setLogSessionId(android.media.metrics.LogSessionId)(https://developer.android.com/reference/android/media/metrics/LogSessionId logSessionId) ` |
| ` https://developer.android.com/reference/android/media/MediaParser` | ` https://developer.android.com/reference/android/media/MediaParser#setParameter(java.lang.String,%20java.lang.Object)(https://developer.android.com/reference/java/lang/String parameterName, https://developer.android.com/reference/java/lang/Object value) ` Sets parser-specific parameters which allow customizing behavior. |
| ` boolean` | ` https://developer.android.com/reference/android/media/MediaParser#supportsParameter(java.lang.String)(https://developer.android.com/reference/java/lang/String parameterName) ` Returns whether the given `parameterName` is supported by this parser. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### PARAMETER_ADTS_ENABLE_CBR_SEEKING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_ADTS_ENABLE_CBR_SEEKING
```

Sets whether constant bitrate seeking should be enabled for ADTS parsing. `boolean`
expected. Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.adts.enableCbrSeeking"


### PARAMETER_AMR_ENABLE_CBR_SEEKING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_AMR_ENABLE_CBR_SEEKING
```

Sets whether constant bitrate seeking should be enabled for AMR. `boolean` expected.
Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.amr.enableCbrSeeking"


### PARAMETER_FLAC_DISABLE_ID3

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_FLAC_DISABLE_ID3
```

Sets whether the ID3 track should be disabled for FLAC. `boolean` expected. Default
value is `false`.

<br />

Constant Value:

"android.media.mediaparser.flac.disableId3"


### PARAMETER_MATROSKA_DISABLE_CUES_SEEKING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MATROSKA_DISABLE_CUES_SEEKING
```

Sets whether Matroska parsing should avoid seeking to the cues element. `boolean`
expected. Default value is `false`.

If this flag is enabled and the cues element occurs after the first cluster, then the
media is treated as unseekable.

<br />

Constant Value:

"android.media.mediaparser.matroska.disableCuesSeeking"


### PARAMETER_MP3_DISABLE_ID3

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP3_DISABLE_ID3
```

Sets whether the ID3 track should be disabled for MP3. `boolean` expected. Default
value is `false`.

<br />

Constant Value:

"android.media.mediaparser.mp3.disableId3"


### PARAMETER_MP3_ENABLE_CBR_SEEKING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP3_ENABLE_CBR_SEEKING
```

Sets whether constant bitrate seeking should be enabled for MP3. `boolean` expected.
Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.mp3.enableCbrSeeking"


### PARAMETER_MP3_ENABLE_INDEX_SEEKING

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP3_ENABLE_INDEX_SEEKING
```

Sets whether MP3 parsing should generate a time-to-byte mapping. `boolean` expected.
Default value is `false`.

Enabling this flag may require to scan a significant portion of the file to compute a seek
point. Therefore, it should only be used if:

- the file is small, or
- the bitrate is variable (or the type of bitrate is unknown) and the seeking metadata provided in the file is not precise enough (or is not present).

<br />

<br />

Constant Value:

"android.media.mediaparser.mp3.enableIndexSeeking"


### PARAMETER_MP4_IGNORE_EDIT_LISTS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP4_IGNORE_EDIT_LISTS
```

Sets whether MP4 parsing should ignore edit lists. `boolean` expected. Default value is
`false`.

<br />

Constant Value:

"android.media.mediaparser.mp4.ignoreEditLists"


### PARAMETER_MP4_IGNORE_TFDT_BOX

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP4_IGNORE_TFDT_BOX
```

Sets whether MP4 parsing should ignore the tfdt box. `boolean` expected. Default value
is `false`.

<br />

Constant Value:

"android.media.mediaparser.mp4.ignoreTfdtBox"


### PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES
```

Sets whether MP4 parsing should treat all video frames as key frames. `boolean`
expected. Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.mp4.treatVideoFramesAsKeyframes"


### PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES
```

Sets whether TS should treat samples consisting of non-IDR I slices as synchronization
samples (key-frames). `boolean` expected. Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.ts.allowNonIdrAvcKeyframes"


### PARAMETER_TS_DETECT_ACCESS_UNITS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_DETECT_ACCESS_UNITS
```

Sets whether TS parsing should split AVC stream into access units based on slice headers.
`boolean` expected. Default value is `false`.

This flag should be left disabled if the stream contains access units delimiters in order
to avoid unnecessary computational costs.

<br />

Constant Value:

"android.media.mediaparser.ts.ignoreDetectAccessUnits"


### PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS
```

Sets whether TS parsing should handle HDMV DTS audio streams. `boolean` expected.
Default value is `false`.

Enabling this flag will disable the detection of SCTE subtitles.

<br />

Constant Value:

"android.media.mediaparser.ts.enableHdmvDtsAudioStreams"


### PARAMETER_TS_IGNORE_AAC_STREAM

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_IGNORE_AAC_STREAM
```

Sets whether TS parsing should ignore AAC elementary streams. `boolean` expected.
Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.ts.ignoreAacStream"


### PARAMETER_TS_IGNORE_AVC_STREAM

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_IGNORE_AVC_STREAM
```

Sets whether TS parsing should ignore AVC elementary streams. `boolean` expected.
Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.ts.ignoreAvcStream"


### PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM
```

Sets whether TS parsing should ignore splice information streams. `boolean` expected.
Default value is `false`.

<br />

Constant Value:

"android.media.mediaparser.ts.ignoreSpliceInfoStream"


### PARAMETER_TS_MODE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARAMETER_TS_MODE
```

Sets the operation mode for TS parsing. `String` expected. Valid values are `"single_pmt"`, `"multi_pmt"`, and `"hls"`. Default value is `"single_pmt"`.

The operation modes alter the way TS behaves so that it can handle certain kinds of
commonly-occurring malformed media.

- `"single_pmt"`: Only the first found PMT is parsed. Others are ignored, even if more PMTs are declared in the PAT.
- `"multi_pmt"`: Behave as described in ISO/IEC 13818-1.
- `"hls"`: Enable `"single_pmt"` mode, and ignore continuity counters.

<br />

<br />

Constant Value:

"android.media.mediaparser.ts.mode"


### PARSER_NAME_AC3

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_AC3
```

Parser for the AC-3 container format, as defined in Digital Audio Compression Standard
(AC-3).

<br />

Constant Value:

"android.media.mediaparser.Ac3Parser"


### PARSER_NAME_AC4

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_AC4
```

Parser for the AC-4 container format, as defined by Dolby AC-4: Audio delivery for
Next-Generation Entertainment Services.

<br />

Constant Value:

"android.media.mediaparser.Ac4Parser"


### PARSER_NAME_ADTS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_ADTS
```

Parser for the ADTS container format, as defined in ISO/IEC 13818-7.

<br />

Constant Value:

"android.media.mediaparser.AdtsParser"


### PARSER_NAME_AMR

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_AMR
```

Parser for the AMR container format, as defined in RFC 4867.

<br />

Constant Value:

"android.media.mediaparser.AmrParser"


### PARSER_NAME_FLAC

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_FLAC
```

Parser for the FLAC container format, as defined in the [spec](https://xiph.org/flac/).

<br />

Constant Value:

"android.media.mediaparser.FlacParser"


### PARSER_NAME_FLV

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_FLV
```

Parser for the FLV container format, as defined in Adobe Flash Video File Format
Specification.

<br />

Constant Value:

"android.media.mediaparser.FlvParser"


### PARSER_NAME_FMP4

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_FMP4
```

Parser for fragmented files using the MP4 container format, as defined in ISO/IEC 14496-12.

<br />

Constant Value:

"android.media.mediaparser.FragmentedMp4Parser"


### PARSER_NAME_MATROSKA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_MATROSKA
```

Parser for the Matroska container format, as defined in the [spec](https://matroska.org/technical/specs/).

<br />

Constant Value:

"android.media.mediaparser.MatroskaParser"


### PARSER_NAME_MP3

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_MP3
```

Parser for the MP3 container format, as defined in ISO/IEC 11172-3.

<br />

Constant Value:

"android.media.mediaparser.Mp3Parser"


### PARSER_NAME_MP4

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_MP4
```

Parser for non-fragmented files using the MP4 container format, as defined in ISO/IEC
14496-12.

<br />

Constant Value:

"android.media.mediaparser.Mp4Parser"


### PARSER_NAME_OGG

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_OGG
```

Parser for the OGG container format, as defined in RFC 3533.

<br />

Constant Value:

"android.media.mediaparser.OggParser"


### PARSER_NAME_PS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_PS
```

Parser for the PS container format, as defined in ISO/IEC 11172-1.

<br />

Constant Value:

"android.media.mediaparser.PsParser"


### PARSER_NAME_TS

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_TS
```

Parser for the TS container format, as defined in ISO/IEC 13818-1.

<br />

Constant Value:

"android.media.mediaparser.TsParser"


### PARSER_NAME_UNKNOWN

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_UNKNOWN
```

Parser name returned by `https://developer.android.com/reference/android/media/MediaParser#getParserName()` when no parser has been selected yet.

<br />

Constant Value:

"android.media.mediaparser.UNKNOWN"


### PARSER_NAME_WAV

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final String PARSER_NAME_WAV
```

Parser for the WAV container format, as defined in Multimedia Programming Interface and Data
Specifications.

<br />

Constant Value:

"android.media.mediaparser.WavParser"


### SAMPLE_FLAG_DECODE_ONLY

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37.1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SAMPLE_FLAG_DECODE_ONLY
```


**This constant was deprecated
in API level 37.1.**   

This flag is no longer supported and will be ignored.

Indicates that the sample should be decoded but not rendered.

<br />

Constant Value:

-2147483648
(0x80000000)


### SAMPLE_FLAG_ENCRYPTED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SAMPLE_FLAG_ENCRYPTED
```

Indicates that the sample is (at least partially) encrypted.

<br />

Constant Value:

1073741824
(0x40000000)


### SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SAMPLE_FLAG_HAS_SUPPLEMENTAL_DATA
```

Indicates that the sample has supplemental data.

Samples will not have this flag set unless the `"android.media.mediaparser.includeSupplementalData"` parameter is set to `true` via
`https://developer.android.com/reference/android/media/MediaParser#setParameter(java.lang.String,%20java.lang.Object)`.

Samples with supplemental data have the following sample data format:

- If the `"android.media.mediaparser.inBandCryptoInfo"` parameter is set, all encryption information.
- (4 bytes) `sample_data_size`: The size of the actual sample data, not including supplemental data or encryption information.
- (`sample_data_size` bytes): The media sample data.
- (remaining bytes) The supplemental data.

<br />

<br />

Constant Value:

268435456
(0x10000000)


### SAMPLE_FLAG_KEY_FRAME

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SAMPLE_FLAG_KEY_FRAME
```

Indicates that the sample holds a synchronization sample.

<br />

Constant Value:

1
(0x00000001)


### SAMPLE_FLAG_LAST_SAMPLE

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int SAMPLE_FLAG_LAST_SAMPLE
```

Indicates that the sample is known to contain the last media sample of the stream.

<br />

Constant Value:

536870912
(0x20000000)


## Public methods

### advance

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean advance (MediaParser.SeekableInputReader seekableInputReader)
```

Makes progress in the extraction of the input media stream, unless the end of the input has
been reached.

This method will block until some progress has been made.

If this instance was created using `https://developer.android.com/reference/android/media/MediaParser#create(android.media.MediaParser.OutputConsumer,%20java.lang.String[])`, the first call to this method will
sniff the content using the selected parser implementations.

<br />

| Parameters ||
|---|---|
| `seekableInputReader` | `MediaParser.SeekableInputReader`: The `https://developer.android.com/reference/android/media/MediaParser.SeekableInputReader` from which to obtain the media container data. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | Whether there is any data left to extract. Returns false if the end of input has been reached. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/media/MediaParser.UnrecognizedInputFormatException` | If the format cannot be recognized by any of the underlying parser implementations. |
| `https://developer.android.com/reference/java/io/IOException` | If an error occurs while reading from the `https://developer.android.com/reference/android/media/MediaParser.SeekableInputReader`. |

### create

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static MediaParser create (MediaParser.OutputConsumer outputConsumer, 
                String... parserNames)
```

Creates an instance whose backing parser will be selected by sniffing the content during the
first `https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)` call. Parser implementations will sniff the content in order of
appearance in `parserNames`.

<br />

| Parameters ||
|---|---|
| `outputConsumer` | `MediaParser.OutputConsumer`: The `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer` to which extracted data is output. This value cannot be `null`. <br /> |
| `parserNames` | `String`: The names of the parsers to sniff the content with. If empty, a default array of names is used. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MATROSKA` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FMP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_ADTS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_TS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_OGG` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_PS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_WAV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AMR` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLAC` |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/MediaParser` | A new instance. This value cannot be `null`. <br /> |

### createByName

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static MediaParser createByName (String name, 
                MediaParser.OutputConsumer outputConsumer)
```

Creates an instance backed by the parser with the given `name`. The returned instance
will attempt parsing without sniffing the content.

<br />

| Parameters ||
|---|---|
| `name` | `String`: The name of the parser that will be associated with the created instance. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MATROSKA` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FMP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_ADTS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_TS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_OGG` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_PS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_WAV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AMR` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLAC` |
| `outputConsumer` | `MediaParser.OutputConsumer`: The `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer` to which track data and samples are pushed. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/MediaParser` | A new instance. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If an invalid name is provided. |

### getLogSessionId

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public LogSessionId getLogSessionId ()
```

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/metrics/LogSessionId` | This value cannot be `null`. <br /> |

### getParserName

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String getParserName ()
```

Returns the name of the backing parser implementation.

If this instance was creating using `https://developer.android.com/reference/android/media/MediaParser#createByName(java.lang.String,%20android.media.MediaParser.OutputConsumer)`, the provided name is returned.
If this instance was created using `https://developer.android.com/reference/android/media/MediaParser#create(android.media.MediaParser.OutputConsumer,%20java.lang.String[])`, this method will return `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` until the first call to `https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)`, after which the name of the
backing parser implementation is returned.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The name of the backing parser implementation, or null if the backing parser implementation has not yet been selected. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MATROSKA` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FMP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_ADTS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_TS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_OGG` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_PS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_WAV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AMR` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLAC` |

### getParserNames

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static List<String> getParserNames (MediaFormat mediaFormat)
```

Returns an immutable list with the names of the parsers that are suitable for container
formats with the given `https://developer.android.com/reference/android/media/MediaFormat`.

A parser supports a `https://developer.android.com/reference/android/media/MediaFormat` if the mime type associated with `https://developer.android.com/reference/android/media/MediaFormat#KEY_MIME` corresponds to the supported container format.

<br />

| Parameters ||
|---|---|
| `mediaFormat` | `MediaFormat`: The `https://developer.android.com/reference/android/media/MediaFormat` to check support for. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/java/lang/String>` | The parser names that support the given `mediaFormat`, or the list of all parsers available if no container specific format information is provided. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_UNKNOWN` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MATROSKA` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FMP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_MP3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_ADTS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC3` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_TS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_OGG` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_PS` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_WAV` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AMR` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_AC4` - `https://developer.android.com/reference/android/media/MediaParser#PARSER_NAME_FLAC` |

### release

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void release ()
```

Releases any acquired resources.

After calling this method, this instance becomes unusable and no other methods should be
invoked.

<br />

### seek

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void seek (MediaParser.SeekPoint seekPoint)
```

Seeks within the media container being extracted.

`https://developer.android.com/reference/android/media/MediaParser.SeekPoint` can be obtained from the `https://developer.android.com/reference/android/media/MediaParser.SeekMap` passed to `https://developer.android.com/reference/android/media/MediaParser.OutputConsumer#onSeekMapFound(android.media.MediaParser.SeekMap)`.

Following a call to this method, the `https://developer.android.com/reference/android/media/MediaParser.InputReader` passed to the next invocation of
`https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)` must provide data starting from `https://developer.android.com/reference/android/media/MediaParser.SeekPoint#position` in the stream.

<br />

| Parameters ||
|---|---|
| `seekPoint` | `MediaParser.SeekPoint`: The `https://developer.android.com/reference/android/media/MediaParser.SeekPoint` to seek to. This value cannot be `null`. <br /> |

### setLogSessionId

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setLogSessionId (LogSessionId logSessionId)
```

<br />

<br />

| Parameters ||
|---|---|
| `logSessionId` | `LogSessionId`: This value cannot be `null`. <br /> |

### setParameter

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public MediaParser setParameter (String parameterName, 
                Object value)
```

Sets parser-specific parameters which allow customizing behavior.

Must be called before the first call to `https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)`.

<br />

| Parameters ||
|---|---|
| `parameterName` | `String`: The name of the parameter to set. See `PARAMETER_*` constants for documentation on possible values. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_ADTS_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_AMR_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_FLAC_DISABLE_ID3` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_EDIT_LISTS` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_TFDT_BOX` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MATROSKA_DISABLE_CUES_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_DISABLE_ID3` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_INDEX_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_MODE` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AAC_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AVC_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_DETECT_ACCESS_UNITS` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS` |
| `value` | `Object`: The value to set for the given `parameterName`. See `PARAMETER_*` constants for documentation on the expected types. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/media/MediaParser` | This instance, for convenience. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalStateException` | If called after calling `https://developer.android.com/reference/android/media/MediaParser#advance(android.media.MediaParser.SeekableInputReader)` on the same instance. |

### supportsParameter

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean supportsParameter (String parameterName)
```

Returns whether the given `parameterName` is supported by this parser.

<br />

| Parameters ||
|---|---|
| `parameterName` | `String`: The parameter name to check support for. One of the `PARAMETER_*` constants. This value cannot be `null`. Value is one of the following: - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_ADTS_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_AMR_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_FLAC_DISABLE_ID3` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_EDIT_LISTS` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_IGNORE_TFDT_BOX` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP4_TREAT_VIDEO_FRAMES_AS_KEYFRAMES` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MATROSKA_DISABLE_CUES_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_DISABLE_ID3` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_CBR_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_MP3_ENABLE_INDEX_SEEKING` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_MODE` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ALLOW_NON_IDR_AVC_KEYFRAMES` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AAC_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_AVC_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_IGNORE_SPLICE_INFO_STREAM` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_DETECT_ACCESS_UNITS` - `https://developer.android.com/reference/android/media/MediaParser#PARAMETER_TS_ENABLE_HDMV_DTS_AUDIO_STREAMS` |

| Returns ||
|---|---|
| `boolean` | Whether the given `parameterName` is supported. <br /> |