Interface PictureInPictureController.SessionPictureInPicture.Delegate
- Enclosing class:
PictureInPictureController.SessionPictureInPicture
public static interface PictureInPictureController.SessionPictureInPicture.Delegate
Delegate for opening and closing picture-in-picture windows on Gecko's behalf.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonEnterPictureInPicture(GeckoSession session, String placementToken) Called when the page loaded insessionrequests picture-in-picture.default voidonExitPictureInPicture(GeckoSession session) Called when the picture-in-picture window created forsessionshould be closed.
-
Method Details
-
onEnterPictureInPicture
@UiThread default void onEnterPictureInPicture(@NonNull GeckoSession session, @NonNull String placementToken) Called when the page loaded insessionrequests picture-in-picture.If the window is already showing a video from another session, call
PictureInPictureController.SessionPictureInPicture.exit()on that session before replacing it.- Parameters:
session- The session the video belongs to.placementToken- Token that opens the picture-in-picture session where it can clone the video, passed toGeckoSessionSettings.Builder.pictureInPictureToken(String). It opens a single session and is only good until this request is answered or superseded. Might be empty if Gecko failed to generate one, in which case no window should be opened.
-
onExitPictureInPicture
Called when the picture-in-picture window created forsessionshould be closed.- Parameters:
session- The session the picture-in-picture window was created for.
-