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
  • iOS player
    • Install FastPix iOS player
    • Play uploaded videos
    • Handle playback errors
  • Flutter player
    • Install FastPix Flutter player
    • Play uploaded videos
    • Handle playback errors
      • Play live and on-demand streams
      • Control video playback
      • Control playback resolution
      • Switch videos dynamically
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Play, pause, and seek
  • Set volume
  • Query playback state
  • Player states
  • Clean up resources
Flutter playerPlayback

Control video playback

Was this page helpful?
Previous

Control playback resolution

Next
Built with

Learn how to use play, pause, seek, volume, and state controls in the FastPix Flutter Player.

The FastPixPlayerController provides methods for managing playback. All methods are available after calling initialize().

Play, pause, and seek

1controller.play(); // Start or resume playback
2controller.pause(); // Pause playback
3controller.seekTo(Duration(seconds: 30)); // Seek to a specific position

Set volume

Set the player volume on a scale from 0.0 (silent) to 1.0 (maximum):

1controller.setVolume(0.75); // Set volume to 75%

Query playback state

Check the current state and position:

1final position = controller.getCurrentPosition(); // Current playback position
2final duration = controller.getTotalDuration(); // Total video duration
3
4// State checks
5final isPlaying = controller.isPlaying; // Returns true if playing
6final isPaused = controller.isPaused; // Returns true if paused
7final isFinished = controller.isFinished; // Returns true if playback completed
8final state = controller.currentState; // Current player state enum

Player states

The player can be in any of these states:

StateDescription
initializedPlayer created but not ready
readyReady to play
playingActively playing
pausedPaused
bufferingWaiting for data
finishedPlayback completed
errorError encountered

Clean up resources

Always dispose the controller when the widget is removed:

1@override
2void dispose() {
3 controller.dispose();
4 super.dispose();
5}