Class PictureInPictureController.SessionPictureInPicture
Object
org.mozilla.geckoview.PictureInPictureController.SessionPictureInPicture
- Enclosing class:
PictureInPictureController
Session picture-in-picture drives the picture-in-picture window for the video a single session
is playing.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDelegate for opening and closing picture-in-picture windows on Gecko's behalf. -
Method Summary
Modifier and TypeMethodDescriptionexit()Notifies Gecko that the picture-in-picture window showing a video from this session has been closed by the application.request()Requests a picture-in-picture window for the video this session last started playing.voidsetKeepActive(boolean keepActive) Sets whether theGeckoViewshowing this session leaves it active when it stops showing it.
-
Method Details
-
request
Requests a picture-in-picture window for the video this session last started playing.- Returns:
- A GeckoResult that completes once the picture-in-picture window is showing the video, or completes exceptionally if it could not be set up. It completes with no window having been opened if the session is not playing a video.
-
exit
Notifies Gecko that the picture-in-picture window showing a video from this session has been closed by the application. Must be called when the application tears the window down itself, so that state held for the video can be released.- Returns:
- A GeckoResult that completes once that state has been released.
-
setKeepActive
@UiThread public void setKeepActive(boolean keepActive) Sets whether theGeckoViewshowing this session leaves it active when it stops showing it. An inactive page is hidden, and pages commonly pause their video when hidden, so set this while a picture-in-picture window is showing one of this session's videos.Once the window is gone, clear it and call
GeckoSession.setActive(boolean)withfalseif the session is no longer showing anywhere, since the view will not do it.- Parameters:
keepActive- Whether to keep this session active.
-