PictureInPictureManager

The class responsible to manage the Picture-in-Picture mode.

Author

Sergio Martinez - smartinez@brightcove.com

Properties

The default value is to reduce Closed Captions by 50% when in Picture-in-Picture mode.

Functions

Link copied to clipboard
This method puts the registered Activity into Picture-in-Picture mode.
Link copied to clipboard
Link copied to clipboard
Checks if there is a registered activity and calls that activity method isInPictureInPictureMode.
Link copied to clipboard
PictureInPictureManager will be disabled if there is no Activity registered or if the Activity previously registered was destroyed.
Link copied to clipboard
open fun onPictureInPictureModeChanged(isInPictureInPictureMode: Boolean, newConfig: Configuration)
This method reacts to the Picture-in-Picture changes and emits DID_ENTER_PICTURE_IN_PICTURE_MODE and DID_EXIT_PICTURE_IN_PICTURE_MODE events.
Link copied to clipboard
open fun onUserLeaveHint()
This method calls enterPictureInPictureMode if the PictureInPictureManager is configured to do so.
Link copied to clipboard
open fun registerActivity(activity: Activity, videoView: BaseVideoView)
This method registers and holds a weak reference to the Activity that will be put into Picture-in-Picture mode.
Link copied to clipboard
open fun setAspectRatio(aspectRatio: Rational): PictureInPictureManager
Sets the aspect ratio.
Link copied to clipboard
open fun setClosedCaptionsEnabled(closedCaptionsEnabled: Boolean): PictureInPictureManager
Enables or disables closed captions for Picture in Picture mode.
Link copied to clipboard
Sets reduction the scale factor for closed captions when entering Picture in Picture mode.
Link copied to clipboard
Enables or disables entering into Picture in Picture mode when the user has put the activity in the background, for example, when of pressing the Home key.
Link copied to clipboard
open fun setSourceRectHint(sourceRectHint: Rect): PictureInPictureManager
Sets the source bounds hint.
Link copied to clipboard
open fun setUserActions(userActions: List<RemoteAction>): PictureInPictureManager
Sets the user actions.
Link copied to clipboard
open fun unregisterActivity(activity: Activity)
Unregister the previously registered activity and clean its references.