VideoPlaybackPictureInPicture


class VideoPlaybackPictureInPicture : BasicPictureInPicture, AutoCloseable


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

Enables seamless resize and allows tracking a View to automatically update the source rectangle hint for smooth animations using the package's ViewBoundsTracker.

Summary

Public functions

open Unit

Releases resources used by this implementation, such as the ViewBoundsTracker.

VideoPlaybackPictureInPicture

Sets the View to be tracked for updating the source rectangle hint.

Inherited functions

From androidx.core.pip.BasicPictureInPicture
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).

From androidx.core.pip.PictureInPictureDelegate

Public constructors

VideoPlaybackPictureInPicture

Added in 1.0.0-alpha02
VideoPlaybackPictureInPicture(provider: PictureInPictureProvider)

Public functions

close

Added in 1.0.0-alpha02
open fun close(): Unit

Releases resources used by this implementation, such as the ViewBoundsTracker. Call this when the implementation is no longer needed (e.g., in Activity.onDestroy).

setPlayerView

Added in 1.0.0-alpha02
fun setPlayerView(view: View?): VideoPlaybackPictureInPicture

Sets the View to be tracked for updating the source rectangle hint. The bounds of this View (e.g., the player view) will be used to ensure smooth entry/exit animations into/out of Picture-in-Picture.

Parameters
view: View?

The View to track, or null to stop tracking and clear the hint.

Returns
VideoPlaybackPictureInPicture

This implementation instance for chaining.