PlayerView
Shared player view - manages ExoPlayer setup, view binding, lifecycle, and event dispatching. Gesture/volume/brightness/key-event input is handled by gestureHelper (PlayerGestureHelper), which is exposed via delegate properties for easier access.
Types
Properties
When true, dynamicOrientation returns portrait for portrait videos. Read from settings in initialize.
The Media3/ExoPlayer androidx.media3.ui.PlayerView widget.
Lifecycle delegation
All gesture, volume, brightness and key-event logic lives here.
Delegate properties (forwarded to gestureHelper for external callers to have easier access)
True when the current video is taller than it is wide. Set by mainCallback on ResizedEvent.
Seek delta used by the basic rew/ffwd click listeners. Read from settings in initialize.
Functions
Cancels any pending auto-hide scheduled by scheduleAutoHide.
Returns the desired ActivityInfo orientation constant based on isVerticalOrientation and autoPlayerRotateEnabled. TV/emulator always returns sensor-landscape. Host fragments call this from Callbacks.playerDimensionsLoaded to apply rotation.
Delegate methods
Called once after bindViews. Sets up the preview seek-bar, subtitle style listener, player callbacks and basic controls; then delegates gesture/input setup to gestureHelper.
This receives the events from the player, if you want to append functionality you do it here, do note that this only receives events for UI changes, and returning early WON'T stop it from changing in e.g. the player time or pause status.
Resize
NOTE: Only one observer at a time per value
Error handling
Schedules a delayed auto-hide of the player UI after delayMs ms. Any previously pending hide is canceled first. The hide fires only when no touch is active and Callbacks.isUIShowing is true; the actual hide action is delegated to Callbacks.onAutoHideUI.
Duration display