Stay organized with collections
Save and categorize content based on your preferences.
MetricsConstants
class MetricsConstants
Summary
Constants
CODEC_AUDIO
static val CODEC_AUDIO: String
Key to extract the codec being used to decode the audio track from the MediaPlayer.getMetrics
return value. The value is a String.
Value: "android.media.mediaplayer.audio.codec"
CODEC_VIDEO
static val CODEC_VIDEO: String
Key to extract the codec being used to decode the video track from the MediaPlayer.getMetrics
return value. The value is a String.
Value: "android.media.mediaplayer.video.codec"
DURATION
static val DURATION: String
Key to extract the duration (in milliseconds) of the media being played from the MediaPlayer.getMetrics
return value. The value is a long.
Value: "android.media.mediaplayer.durationMs"
ERRORS
static val ERRORS: String
Key to extract the count of errors encountered while playing the media from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.err"
ERROR_CODE
static val ERROR_CODE: String
Key to extract an (optional) error code detected while playing the media from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.errcode"
FRAMES
static val FRAMES: String
Key to extract the count of video frames played from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.frames"
FRAMES_DROPPED
static val FRAMES_DROPPED: String
Key to extract the count of video frames dropped from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.dropped"
HEIGHT
static val HEIGHT: String
Key to extract the height (in pixels) of the video track from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.height"
MIME_TYPE_AUDIO
static val MIME_TYPE_AUDIO: String
Key to extract the MIME type of the audio track from the MediaPlayer.getMetrics
return value. The value is a String.
Value: "android.media.mediaplayer.audio.mime"
MIME_TYPE_VIDEO
static val MIME_TYPE_VIDEO: String
Key to extract the MIME type of the video track from the MediaPlayer.getMetrics
return value. The value is a String.
Value: "android.media.mediaplayer.video.mime"
PLAYING
static val PLAYING: String
Key to extract the playing time (in milliseconds) of the media being played from the MediaPlayer.getMetrics
return value. The value is a long.
Value: "android.media.mediaplayer.playingMs"
WIDTH
static val WIDTH: String
Key to extract the width (in pixels) of the video track from the MediaPlayer.getMetrics
return value. The value is an integer.
Value: "android.media.mediaplayer.width"
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MediaPlayer.MetricsConstants\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMetricsConstants\n================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaPlayer.MetricsConstants \"View this page in Java\") \n\n```\nclass MetricsConstants\n```\n\n|---|-------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaPlayer.MetricsConstants](#) |\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CODEC_AUDIO](#CODEC_AUDIO:kotlin.String) Key to extract the codec being used to decode the audio track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [CODEC_VIDEO](#CODEC_VIDEO:kotlin.String) Key to extract the codec being used to decode the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [DURATION](#DURATION:kotlin.String) Key to extract the duration (in milliseconds) of the media being played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ERRORS](#ERRORS:kotlin.String) Key to extract the count of errors encountered while playing the media from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [ERROR_CODE](#ERROR_CODE:kotlin.String) Key to extract an (optional) error code detected while playing the media from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [FRAMES](#FRAMES:kotlin.String) Key to extract the count of video frames played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [FRAMES_DROPPED](#FRAMES_DROPPED:kotlin.String) Key to extract the count of video frames dropped from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [HEIGHT](#HEIGHT:kotlin.String) Key to extract the height (in pixels) of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MIME_TYPE_AUDIO](#MIME_TYPE_AUDIO:kotlin.String) Key to extract the MIME type of the audio track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [MIME_TYPE_VIDEO](#MIME_TYPE_VIDEO:kotlin.String) Key to extract the MIME type of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [PLAYING](#PLAYING:kotlin.String) Key to extract the playing time (in milliseconds) of the media being played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [WIDTH](#WIDTH:kotlin.String) Key to extract the width (in pixels) of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. |\n\nConstants\n---------\n\n### CODEC_AUDIO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CODEC_AUDIO: String\n```\n\nKey to extract the codec being used to decode the audio track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediaplayer.audio.codec\"\n\n### CODEC_VIDEO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CODEC_VIDEO: String\n```\n\nKey to extract the codec being used to decode the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediaplayer.video.codec\"\n\n### DURATION\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val DURATION: String\n```\n\nKey to extract the duration (in milliseconds) of the media being played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a long. \n\n Value: \"android.media.mediaplayer.durationMs\"\n\n### ERRORS\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERRORS: String\n```\n\nKey to extract the count of errors encountered while playing the media from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.err\"\n\n### ERROR_CODE\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val ERROR_CODE: String\n```\n\nKey to extract an (optional) error code detected while playing the media from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.errcode\"\n\n### FRAMES\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FRAMES: String\n```\n\nKey to extract the count of video frames played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.frames\"\n\n### FRAMES_DROPPED\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val FRAMES_DROPPED: String\n```\n\nKey to extract the count of video frames dropped from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.dropped\"\n\n### HEIGHT\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val HEIGHT: String\n```\n\nKey to extract the height (in pixels) of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.height\"\n\n### MIME_TYPE_AUDIO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MIME_TYPE_AUDIO: String\n```\n\nKey to extract the MIME type of the audio track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediaplayer.audio.mime\"\n\n### MIME_TYPE_VIDEO\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val MIME_TYPE_VIDEO: String\n```\n\nKey to extract the MIME type of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a String. \n\n Value: \"android.media.mediaplayer.video.mime\"\n\n### PLAYING\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val PLAYING: String\n```\n\nKey to extract the playing time (in milliseconds) of the media being played from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is a long. \n\n Value: \"android.media.mediaplayer.playingMs\"\n\n### WIDTH\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val WIDTH: String\n```\n\nKey to extract the width (in pixels) of the video track from the [MediaPlayer.getMetrics](/reference/kotlin/android/media/MediaPlayer#getMetrics()) return value. The value is an integer. \n\n Value: \"android.media.mediaplayer.width\""]]