Play uploaded videos
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).
Note:
streamTypedefaults toon-demand. Set it tolive-streamfor a live stream.
Play a direct URL
Use setMediaItem when you already have a playback URL (HLS .m3u8, DASH, progressive MP4, or other supported format):
Start playback in your Activity
Call the playback setup method from onStart to begin streaming:
Frequently asked questions
How do I play a FastPix video by playback ID?
Call setFastPixMediaItem and pass the playbackId you copied from the FastPix dashboard. The SDK resolves the playback URL automatically (https://stream.fastpix.com/{playbackId}.m3u8).
Can I play a direct HLS or MP4 URL?
Yes. Use setMediaItem(MediaItem.fromUri(url)) for a playback URL you already have, including HLS .m3u8, DASH, and progressive MP4 or other supported formats.
What is the difference between setFastPixMediaItem and setMediaItem?
setFastPixMediaItem builds a FastPix stream from a playbackId with options like resolution, token, and stream type. setMediaItem plays a direct URL you supply, with no FastPix resolution.
How do I play a live stream?
streamType defaults to on-demand. Set it to live-stream in the setFastPixMediaItem builder to play live content.
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.