Play uploaded videos
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:
Define the player configuration
The configuration controls player behavior such as autoplay settings, quality preferences, and controls:
Initialize the controller
Connect your data source and configuration to the player:
Render the player widget
Use the FastPixPlayer widget in your layout. You can control width, height, and aspect ratio:
Important: Always call
controller.dispose()in your widget’sdispose()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.