Added in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#constants) \| [Inherited Methods](https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#inhmethods)

# MediaPlayer.MetricsConstants

*** ** * ** ***

` public static final class MediaPlayer.MetricsConstants `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

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

<br />

*** ** * ** ***

## Summary

| ### Constants ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#CODEC_AUDIO` Key to extract the codec being used to decode the audio track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#CODEC_VIDEO` Key to extract the codec being used to decode the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#DURATION` Key to extract the duration (in milliseconds) of the media being played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#ERRORS` Key to extract the count of errors encountered while playing the media from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#ERROR_CODE` Key to extract an (optional) error code detected while playing the media from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#FRAMES` Key to extract the count of video frames played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#FRAMES_DROPPED` Key to extract the count of video frames dropped from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#HEIGHT` Key to extract the height (in pixels) of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#MIME_TYPE_AUDIO` Key to extract the MIME type of the audio track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#MIME_TYPE_VIDEO` Key to extract the MIME type of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#PLAYING` Key to extract the playing time (in milliseconds) of the media being played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |
| `https://developer.android.com/reference/java/lang/String` | `https://developer.android.com/reference/android/media/MediaPlayer.MetricsConstants#WIDTH` Key to extract the width (in pixels) of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. |

### 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

### CODEC_AUDIO

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

```
public static final String CODEC_AUDIO
```

Key to extract the codec being used to decode the audio track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a String.

<br />

Constant Value: "android.media.mediaplayer.audio.codec"

### CODEC_VIDEO

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

```
public static final String CODEC_VIDEO
```

Key to extract the codec being used to decode the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a String.

<br />

Constant Value: "android.media.mediaplayer.video.codec"

### DURATION

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

```
public static final String DURATION
```

Key to extract the duration (in milliseconds) of the media being played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a long.

<br />

Constant Value: "android.media.mediaplayer.durationMs"

### ERRORS

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

```
public static final String ERRORS
```

Key to extract the count of errors encountered while playing the media from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.err"

### ERROR_CODE

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

```
public static final String ERROR_CODE
```

Key to extract an (optional) error code detected while playing the media from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.errcode"

### FRAMES

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

```
public static final String FRAMES
```

Key to extract the count of video frames played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.frames"

### FRAMES_DROPPED

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

```
public static final String FRAMES_DROPPED
```

Key to extract the count of video frames dropped from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.dropped"

### HEIGHT

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

```
public static final String HEIGHT
```

Key to extract the height (in pixels) of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.height"

### MIME_TYPE_AUDIO

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

```
public static final String MIME_TYPE_AUDIO
```

Key to extract the MIME type of the audio track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a String.

<br />

Constant Value: "android.media.mediaplayer.audio.mime"

### MIME_TYPE_VIDEO

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

```
public static final String MIME_TYPE_VIDEO
```

Key to extract the MIME type of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a String.

<br />

Constant Value: "android.media.mediaplayer.video.mime"

### PLAYING

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

```
public static final String PLAYING
```

Key to extract the playing time (in milliseconds) of the media being played from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is a long.

<br />

Constant Value: "android.media.mediaplayer.playingMs"

### WIDTH

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

```
public static final String WIDTH
```

Key to extract the width (in pixels) of the video track from the `https://developer.android.com/reference/android/media/MediaPlayer#getMetrics()` return value. The value is an integer.

<br />

Constant Value: "android.media.mediaplayer.width"