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
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Set up playback
  • Create a data source
  • Define the player configuration
  • Initialize the controller
  • Render the player widget
  • What’s next
Flutter player

Play uploaded videos

Was this page helpful?
Previous

Handle playback errors

Next
Built with

Learn how to play a FastPix video in your Flutter app using a playback ID.

Set up playback

Playing a video requires four steps: create a data source, define the player configuration, initialize the controller, and render the player widget.

Create a data source

The data source tells the player what to play. Provide your playbackId and optional metadata:

1final dataSource = FastPixPlayerDataSource.hls(
2 playbackId: 'your-playback-id-here',
3 title: 'Sample HLS Stream',
4 description: 'A sample HLS stream from FastPix',
5 thumbnailUrl: 'https://www.example.com/thumbnail.jpg',
6);

Define the player configuration

The configuration controls player behavior such as autoplay settings, quality preferences, and controls:

1final configuration = FastPixPlayerConfiguration();

Initialize the controller

Connect your data source and configuration to the player:

1controller = FastPixPlayerController();
2controller.initialize(dataSource: dataSource, configuration: configuration);

Render the player widget

Use the FastPixPlayer widget in your layout. You can control width, height, and aspect ratio:

1return FastPixPlayer(
2 controller: controller,
3 width: 350,
4 height: 200,
5 aspectRatio: FastPixAspectRatio.ratio16x9,
6);

Important: Always call controller.dispose() in your widget’s dispose() method. Forgetting this can cause memory leaks, especially on Android.

What’s next

  • Play live and on-demand streams to configure stream types.
  • Secure video playback to protect content with tokens.
  • Control playback resolution to manage video quality.