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 Type
    Method
    Description
    default void
    onEnterPictureInPicture(GeckoSession session, String placementToken)
    Called when the page loaded in session requests picture-in-picture.
    default void
    Called when the picture-in-picture window created for session should be closed.
  • Method Details

    • onEnterPictureInPicture

      @UiThread default void onEnterPictureInPicture(@NonNull GeckoSession session, @NonNull String placementToken)
      Called when the page loaded in session requests 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 to GeckoSessionSettings.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

      @UiThread default void onExitPictureInPicture(@NonNull GeckoSession session)
      Called when the picture-in-picture window created for session should be closed.
      Parameters:
      session - The session the picture-in-picture window was created for.