ActivityFullscreenHandler

class ActivityFullscreenHandler @JvmOverloads constructor(activity: Activity, lockLandscape: Boolean = true, onFullscreenChanged: (isFullscreen: Boolean) -> Unit? = null) : FullscreenHandler

Ready-made FullscreenHandler for the common case: hides/shows the system bars edge-to-edge and, with lockLandscape, drives screen orientation.

With lockLandscape = true (the default):

  • Entering fullscreen locks the activity to sensor landscape, so tapping the fullscreen button in portrait rotates into landscape fullscreen.

  • Exiting locks back to portrait, so the player returns to its embedded position even while the device is still physically held in landscape.

  • Either lock is released back to the activity's original requestedOrientation once the device is physically aligned with it, so sensor rotation (and OGPlayerView's autoFullscreenOnRotate) keeps working after button-driven transitions.

onFullscreenChanged lets the host resize its layout (e.g. switch the player between an embedded 16:9 box and fillMaxSize).

Constructors

Link copied to clipboard
constructor(activity: Activity, lockLandscape: Boolean = true, onFullscreenChanged: (isFullscreen: Boolean) -> Unit? = null)

Functions

Link copied to clipboard
open override fun onEnterFullscreen()
Link copied to clipboard
open override fun onExitFullscreen()