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
      • Secure video playback
      • Use a custom domain
      • Optimize live streaming
LogoLogo
StatusSupportDiscussionsLog inSign Up
On this page
  • Secure on-demand playback
  • Secure live stream playback
  • How tokens protect your content
  • Refresh tokens at runtime
Flutter playerAdvanced features

Secure video playback

Was this page helpful?
Previous

Use a custom domain

Next
Built with

Learn how to protect video content using JWT tokens in the FastPix Flutter Player.

The FastPix Flutter Player supports token-based authentication for both on-demand and live streams. Pass a valid JWT token in the data source to restrict access to authorized viewers.

Secure on-demand playback

1final dataSource = FastPixPlayerDataSource.hls(
2 playbackId: 'your-playback-id-here',
3 streamType: StreamType.onDemand,
4 token: "jwt-token",
5);

Secure live stream playback

1final dataSource = FastPixPlayerDataSource.hls(
2 playbackId: 'your-playback-id-here',
3 streamType: StreamType.live,
4 token: "jwt-token",
5);

How tokens protect your content

  • Only viewers with a valid, cryptographically signed token can access the stream.
  • Tokens can include expiration timestamps, restricting playback to a defined time window.
  • Tokens can be generated per user or session for user-specific access control.
  • Signed tokens prevent unauthorized URL sharing, protecting content from piracy and hotlinking.

Refresh tokens at runtime

If a token expires during a session, you can update the data source without reinitializing the player:

1final refreshedDataSource = FastPixPlayerDataSource.hls(
2 playbackId: 'your-playback-id-here',
3 streamType: StreamType.onDemand,
4 token: "new-jwt-token",
5);
6await controller.updateDataSource(refreshedDataSource);

For details on generating JWT tokens, see Secure playback with JWTs.