BasicPictureInPicture


open class BasicPictureInPicture : PictureInPictureDelegate

Known direct subclasses
VideoPlaybackPictureInPicture

Picture-in-Picture implementation optimized for Video Playback applications.


Basic Picture-in-Picture implementation.

Configures PiP with a specific aspect ratio, custom actions, and controls enter behavior. Seamless resize is disabled and no sourceRectHint is used.

Summary

Public constructors

BasicPictureInPicture(
    pictureInPictureProvider: PictureInPictureProvider
)

Public functions

BasicPictureInPicture

Sets the custom actions to be available in the Picture-in-Picture menu.

BasicPictureInPicture
setAspectRatio(aspectRatio: Rational)

Sets the desired aspect ratio for the Picture-in-Picture window.

BasicPictureInPicture
setEnabled(enabled: Boolean)

Sets whether the activity should automatically enter Picture-in-Picture mode when eligible (e.g., when swiping to home).

Public constructors

BasicPictureInPicture

Added in 1.0.0-alpha02
BasicPictureInPicture(
    pictureInPictureProvider: PictureInPictureProvider
)

Public functions

setActions

Added in 1.0.0-alpha02
fun setActions(actions: List<RemoteAction>): BasicPictureInPicture

Sets the custom actions to be available in the Picture-in-Picture menu.

Parameters
actions: List<RemoteAction>

A list of RemoteActions.

Returns
BasicPictureInPicture

This implementation instance for chaining.

setAspectRatio

Added in 1.0.0-alpha02
fun setAspectRatio(aspectRatio: Rational): BasicPictureInPicture

Sets the desired aspect ratio for the Picture-in-Picture window.

Parameters
aspectRatio: Rational

The desired width/height ratio.

Returns
BasicPictureInPicture

This implementation instance for chaining.

setEnabled

Added in 1.0.0-alpha02
fun setEnabled(enabled: Boolean): BasicPictureInPicture

Sets whether the activity should automatically enter Picture-in-Picture mode when eligible (e.g., when swiping to home). This indicates the "willingness to enter PiP".

Parameters
enabled: Boolean

True if the Activity is PiP-able, false otherwise.

Returns
BasicPictureInPicture

This implementation instance for chaining.

Protected properties

pictureInPictureParamsBuilder

Added in 1.0.0-alpha02
protected val pictureInPictureParamsBuilderPictureInPictureParamsCompat.Builder