interface MKPictureInPictureApi: Any
Fields
Name | Description |
---|---|
abstract isPictureInPictureAvailable: Boolean
|
Whether Picture-In-Picture (PiP) mode is available. |
abstract isPictureInPicture: Boolean
|
Whether the view is currently in Picture-In-Picture (PiP) mode. |
Methods
enterPictureInPicture
abstract fun enterPictureInPicture()
Puts the view into Picture-In-Picture (PiP) mode. Has no effect if isPictureInPictureAvailable is false or if the view is already in PiP mode.
ReturnValue
Name | Description |
---|---|
Unit
|
exitPictureInPicture
abstract fun exitPictureInPicture()
Pulls the view out of Picture-In-Picture (PiP) mode. Has no effect if isPictureInPictureAvailable is false or if the view is currently not in PiP mode.
ReturnValue
Name | Description |
---|---|
Unit
|
onPictureInPictureModeChanged
abstract fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration?)
When using Picture-in-Picture feature, this method has to be called from Activity.
Parameters
Name | Description |
---|---|
isInPictureInPictureMode: Boolean
|
True if the activity is in picture-in-picture mode. |
newConfig: Configuration?
|
The new configuration of the activity with the state |
ReturnValue
Name | Description |
---|---|
Unit
|
Represents the base functions required by MKPlayer to enable and handle Picture-In-Picture mode.
To implement PictureInPicture in application, please make manifest changes as mentioned in https://developer.android.com/guide/topics/ui/picture-in-picture
To use MKPlayer api's to enter Picture-in-picture mode please see below code snippet
In Activity override onPictureInPictureModeChanged method, which is called by the system when the activity changes to and from picture-in-picture mode, inside call onPictureInPictureModeChanged method.