For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
StatusSupportDiscussionsLog inSign Up
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
Docs HomeAPI ReferenceVideo on DemandAI FeaturesLive StreamingVideo PlayerVideo DataCloud PlayoutRecipes
  • Player SDKs
    • Introduction
  • Web player
    • Install the FastPix web player
    • Play uploaded videos
    • Handle playback errors
  • Android player
    • Install FastPix Android player
    • Set up the player
    • Play uploaded videos
    • Handle playback errors
      • Enable secure video playback
      • Use custom domain
      • Switch audio tracks
      • Switch subtitle tracks
      • Add seek preview thumbnails
      • Enable fullscreen mode
      • Monitor video data
  • iOS player
    • Install FastPix iOS player
    • Play uploaded videos
    • Handle playback errors
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Handle configuration changes
  • Enable tap gesture
  • Release the player
Android playerAdvanced features

Enable fullscreen mode

Was this page helpful?
Previous

Monitor video data

Next
Built with

Learn how to handle configuration changes and player retention for fullscreen playback in the FastPix Android Player.

Handle configuration changes

By default, PlayerView retains the player instance across configuration changes (such as device rotation). This is controlled by the retainPlayerOnConfigChange property, which defaults to true.

For this to work correctly, assign an android:id to your PlayerView in the XML layout. Without an ID, the view can’t retain or recover the player instance across rotation:

1<io.fastpix.media3.PlayerView
2 android:id="@+id/playerView"
3 android:layout_width="match_parent"
4 android:layout_height="match_parent" />

Enable tap gesture

Enable single-tap to toggle play/pause, which is useful for fullscreen player UIs:

1playerView.isTapGestureEnabled = true

This uses togglePlayPause() internally.

Release the player

Call playerView.release() in onDestroy when the Activity is finishing to force a release even if retention is enabled:

1override fun onDestroy() {
2 super.onDestroy()
3 player?.removePlaybackListener(playbackListener)
4 if (isFinishing) {
5 playerView.release()
6 }
7}