com.mediakind.mkplayer.api

package com.mediakind.mkplayer.api

Classes

Name Description
interface MKPBufferApi: Any

This buffer API should be accessible using player buffer

interface MKPEventHandler: Any

Defines event listeners of the MKPlayer

interface MKPictureInPictureApi: Any

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


val configuration = MKPlayerConfiguration()

// Pass as true if Bitmovin UI is required
this.configuration!!.isUiEnabled = false

// Enable Pip
this.configuration?.isPictureInPictureEnabled = true

val mkplayer = MKPlayer(
applicationContext,
pip_rootView,
configuration!!
)

// Pass activity to create Pip Handler
mkplayer.setPictureInPictureHandler(this)

// Call enterPictureInPicture on user action of minimise or
// while leaving activity in onUserLeavingHint().
mkplayer.enterPictureInPicture()

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.



override fun onPictureInPictureModeChanged(
isInPictureInPictureMode: Boolean, newConfig: Configuration
) {
super.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)

mkplayer.onPictureInPictureModeChanged(isInPictureInPictureMode, newConfig)
}
interface MKPlayerApi: Any

Defines the public API of the MKPlayer.

interface UserActionApi: MKPlayerApi, Any

Defines the user action's while playback.