PipHandler
Implemented by the host app to put the activity into picture-in-picture. Passing a handler to OGPlayerView IS the enable switch: with one set, the player feeds it live video state (aspect ratio, on-screen bounds, auto-enter eligibility) and reacts to PiP transitions — there is no PiP button in the player chrome, entering is the handler's (i.e. the developer's) decision.
ActivityPipHandler is the ready-made implementation covering the common case; implement this interface directly only for custom presentations.
Inheritors
Properties
Functions
Called by OGPlayerView whenever the video state relevant to PiP changes — implementations use it to keep the system's PiP parameters (aspect ratio, source bounds, auto-enter) current. Not host-app API.
Called by the handler's OWNER (the host) when the player screen closes while the activity lives on — implementations undo whatever they registered on the activity so it cannot keep reacting (e.g. auto-entering PiP) for screens without a player. OGPlayerView additionally pushes a final non-eligible PipVideoState on dispose, which covers the PiP parameters but not an implementation's own listeners. Default: no-op.