Handle playback errors
Learn how to detect and respond to playback errors in the FastPix Android Player.
Listen for errors
The PlaybackListener interface includes an onError callback that fires when a playback or validation error occurs. Attach the listener to your player to capture errors:
Validation errors
When you call setFastPixMediaItem, the SDK validates the configuration before starting playback. If validation fails (for example, an empty playbackId), the method returns false and the error details arrive through PlaybackListener.onError().
Common error scenarios
- Empty or invalid playback ID: The SDK can’t resolve the stream URL.
- Expired or invalid playback token: Secure streams reject the request if the token has expired or is malformed.
- Network issues: Unstable connections cause buffering or playback failures. Use
onBufferingStartandonBufferingEndcallbacks to show appropriate UI. - Unsupported format: The stream uses a format or codec not supported by the device.