Control video playback
Learn how to use play, pause, seek, and other playback controls in the FastPix Android Player.
All playback control methods are on FastPixPlayer and are safe to call from the main thread. They delegate to Media3 internally.
Play, pause, and toggle
play()starts playback if the player is prepared. If buffering or ready, it resumes. CallsetMediaItem(...)orsetFastPixMediaItem { ... }first.pause()pauses playback if currently playing.togglePlayPause()is a convenience method for tap gestures or a single play/pause button.
Seek to a position
Seek events are surfaced through PlaybackListener.onSeekStart and onSeekEnd.
Query playback state
Use getPlaybackState() with buffering callbacks to show loading spinners in your UI.
Autoplay
Control whether playback starts automatically when the player is ready:
Use setPlayWhenReady(true) for a one-off “start when ready” action, or configure autoplay through FastPixPlayer.Builder for a persistent player-level policy.