Learn how to import the FastPix Android Player SDK and initialize the player in your Activity.
You can either use PlayerView on its own (it auto-creates a FastPixPlayer with default settings), or create a configured FastPixPlayer and attach it to PlayerView.
Declare the player objects globally in your Activity or Fragment so they’re accessible throughout the lifecycle:
Create a FastPixPlayer instance using the builder pattern and attach it to your PlayerView:
When using io.fastpix.media3.PlayerView in your XML layout, keep these properties in mind:
PlayerView.retainPlayerOnConfigChange is true by default. Assign an android:id in XML so the view can retain the player instance across rotation.playerView.isTapGestureEnabled = true to enable single-tap toggle play/pause using togglePlayPause().playerView.release() in onDestroy when the Activity is finishing (isFinishing == true) to force a release even if retention is enabled.Remove the playback listener and release the player when the Activity is destroyed: