Stay organized with collections
Save and categorize content based on your preferences.
interface MediaPlayerControl
Summary
Public methods
canPause
abstract fun canPause(): Boolean
canSeekBackward
abstract fun canSeekBackward(): Boolean
canSeekForward
abstract fun canSeekForward(): Boolean
getAudioSessionId
abstract fun getAudioSessionId(): Int
Get the audio session id for the player used by this VideoView. This can be used to apply audio effects to the audio track of a video.
Return |
Int |
The audio session, or 0 if there was an error. |
getBufferPercentage
abstract fun getBufferPercentage(): Int
getCurrentPosition
abstract fun getCurrentPosition(): Int
getDuration
abstract fun getDuration(): Int
isPlaying
abstract fun isPlaying(): Boolean
pause
abstract fun pause(): Unit
seekTo
abstract fun seekTo(pos: Int): Unit
start
abstract fun start(): Unit
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaController.MediaPlayerControl\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nMediaPlayerControl\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/widget/MediaController.MediaPlayerControl \"View this page in Java\") \n\n```\ninterface MediaPlayerControl\n```\n\n|--------------------------------------------------------|\n| [android.widget.MediaController.MediaPlayerControl](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [VideoView](/reference/kotlin/android/widget/VideoView) |---------------------------------------------------------|------------------------| | [VideoView](/reference/kotlin/android/widget/VideoView) | Displays a video file. | |\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [canPause](#canPause())`()` \u003cbr /\u003e |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [canSeekBackward](#canSeekBackward())`()` \u003cbr /\u003e |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [canSeekForward](#canSeekForward())`()` \u003cbr /\u003e |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getAudioSessionId](#getAudioSessionId())`()` Get the audio session id for the player used by this VideoView. |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getBufferPercentage](#getBufferPercentage())`()` \u003cbr /\u003e |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getCurrentPosition](#getCurrentPosition())`()` \u003cbr /\u003e |\n| abstract [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getDuration](#getDuration())`()` \u003cbr /\u003e |\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isPlaying](#isPlaying())`()` \u003cbr /\u003e |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [pause](#pause())`()` \u003cbr /\u003e |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [seekTo](#seekTo(kotlin.Int))`(`pos:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` \u003cbr /\u003e |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [start](#start())`()` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### canPause\n\nAdded in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun canPause(): Boolean\n``` \n\n### canSeekBackward\n\nAdded in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun canSeekBackward(): Boolean\n``` \n\n### canSeekForward\n\nAdded in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun canSeekForward(): Boolean\n``` \n\n### getAudioSessionId\n\nAdded in [API level 18](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getAudioSessionId(): Int\n```\n\nGet the audio session id for the player used by this VideoView. This can be used to apply audio effects to the audio track of a video.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The audio session, or 0 if there was an error. |\n\n### getBufferPercentage\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getBufferPercentage(): Int\n``` \n\n### getCurrentPosition\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getCurrentPosition(): Int\n``` \n\n### getDuration\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun getDuration(): Int\n``` \n\n### isPlaying\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun isPlaying(): Boolean\n``` \n\n### pause\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun pause(): Unit\n``` \n\n### seekTo\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun seekTo(pos: Int): Unit\n``` \n\n### start\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun start(): Unit\n```"]]