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
  • Play a FastPix video with a playback ID
  • Play a direct URL
  • Start playback in your Activity
  • What’s next
Android player

Play uploaded videos

Was this page helpful?
Previous

Handle playback errors

Next
Built with

Learn how to play FastPix videos and direct URLs using the FastPix Android Player SDK.

Play a FastPix video with a playback ID

Use setFastPixMediaItem when you have a playbackId from the FastPix dashboard. The SDK resolves the playback URL automatically (https://stream.fastpix.com/{playbackId}.m3u8).

1private fun startPlayback() {
2 player?.setFastPixMediaItem {
3 playbackId = "YOUR_PLAYBACK_ID" // required
4 }
5}

Note: StreamType is included in the builder for API compatibility but is not yet applied to the resolved URL in this SDK version.

Play a direct URL

Use setMediaItem when you already have a playback URL (HLS .m3u8, DASH, progressive MP4, or other supported format):

1player?.setMediaItem(MediaItem.fromUri("https://example.com/video.m3u8"))

Start playback in your Activity

Call the playback setup method from onStart to begin streaming:

1override fun onStart() {
2 super.onStart()
3 startPlayback()
4}
5
6private fun startPlayback() {
7 playbackListener = object : PlaybackListener {
8 override fun onPlay() {}
9 override fun onPause() {}
10 override fun onPlaybackStateChanged(isPlaying: Boolean) {}
11 override fun onError(error: PlaybackException) {}
12 }
13 player?.addPlaybackListener(playbackListener)
14
15 player?.setFastPixMediaItem {
16 playbackId = "YOUR_PLAYBACK_ID"
17 }
18}

What’s next

  • Enable secure video playback to protect content with tokens.
  • Set playback resolution to control video quality.
  • Control video playback for play, pause, and seek.