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
      • Control video playback
      • Adjust volume and mute
      • Control playback speed
      • Set playback resolution
      • Control rendition order
      • Listen to playback events
  • 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
  • Play, pause, and toggle
  • Seek to a position
  • Query playback state
  • Autoplay
Android playerPlayback

Control video playback

Was this page helpful?
Previous

Adjust volume and mute

Next
Built with

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

1player.play() // Start or resume playback
2player.pause() // Pause playback
3player.togglePlayPause() // Toggle between play and pause
  • play() starts playback if the player is prepared. If buffering or ready, it resumes. Call setMediaItem(...) or setFastPixMediaItem { ... } 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

1player.seekTo(positionMs = 5_000) // Seek to 5 seconds

Seek events are surfaced through PlaybackListener.onSeekStart and onSeekEnd.

Query playback state

1val pos = player.getCurrentPosition() // Current position in milliseconds
2val duration = player.getDuration() // Total duration (0L when unknown)
3val state = player.getPlaybackState() // Media3 state: STATE_IDLE/BUFFERING/READY/ENDED

Use getPlaybackState() with buffering callbacks to show loading spinners in your UI.

Autoplay

Control whether playback starts automatically when the player is ready:

1player.setPlayWhenReady(true) // Start automatically when ready
2val willPlay = player.getPlayWhenReady()
3val isAutoPlay = player.autoplay // Player-level autoplay policy

Use setPlayWhenReady(true) for a one-off “start when ready” action, or configure autoplay through FastPixPlayer.Builder for a persistent player-level policy.