Class FullscreenSession
- All Implemented Interfaces:
Serializable
Page.requestFullscreen() and Component.requestFullscreen().
A session is the unit that ties together one lifecycle (PENDING → ACTIVE or REJECTED → an EXITED state), the
owner component that asked for fullscreen (empty when
the whole page was requested), and how it ended. Subscribe to
stateSignal() to react to lifecycle transitions; call
exit() to end the session from server code. The page-level
Page.fullscreenSignal() answers the cross-session "is anything
fullscreen right now" question and is independent of sessions.
Only one session can be active per page at a time. Starting a new request
while one is active transitions the old session to
EXITED_BY_CODE before the new
session is returned.
If a request is rejected (no user activation, permissions policy, etc.) or
exits, the error() accessor returns the browser-provided error
message when available, otherwise empty.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionerror()Returns the browser-provided error message when this session is inREJECTED, or empty otherwise.voidexit()Ends this session.owner()Returns the component that requested fullscreen, or empty if the entire page was requested viaPage.requestFullscreen().Returns a read-only signal that tracks this session's lifecycle state.
-
Method Details
-
stateSignal
Returns a read-only signal that tracks this session's lifecycle state.The signal starts at
FullscreenSessionState.PENDINGand transitions throughFullscreenSessionState.ACTIVEon a successful request, or directly to a terminal state on rejection or exit. Once in a terminal state the signal does not change again. Subscribe withSignal.effect(owner, ...)to react to transitions.- Returns:
- the read-only session state signal
-
owner
Returns the component that requested fullscreen, or empty if the entire page was requested viaPage.requestFullscreen(). Useful for binding the active component's appearance (e.g. anexpandedstyle class) only on the owner.- Returns:
- the owner component, or empty for a page-level session
-
error
Returns the browser-provided error message when this session is inREJECTED, or empty otherwise. Used for logging and surfacing diagnostics — the contents are browser-defined and not stable enough to drive logic.- Returns:
- the error message, when available
-
exit
public void exit()Ends this session. Equivalent toPage.exitFullscreen()when this session is active; a no-op if the session already ended.
-