# Errors Reference
When a playback error occurs, the player delivers onPlaybackError(error) through ByteArkPlayerListener. Ad-related errors are delivered separately via onAdsError(error).
# Receiving errors
final listener = ByteArkPlayerListener(
onPlaybackError: (ByteArkPlayerPlaybackErrorData error) {
debugPrint("Playback error: code=${error.code}, message=${error.message}");
// Handle the error (show a dialog, snackbar, etc.)
},
onAdsError: (ByteArkPlayerAdsErrorData error) {
debugPrint("Ads error: ${error.message}");
// Typically does not stop main playback
},
);
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
# Error categories
Most errors in the Flutter SDK are propagated from the underlying native SDKs (ExoPlayer on Android, AVPlayer on iOS):
| Category | Description |
|---|---|
| Source error | Unable to load or parse the manifest (wrong URL, server 4xx/5xx) |
| Network error | Network connection failed |
| Decoder error | Device cannot decode the video/audio format |
| DRM error | Failed to obtain a Widevine/FairPlay license |
| Renderer error | Failure while rendering the video |
# Suggested handling
- Source / Network error: show a user-friendly message and allow retry
- DRM error: verify the
ByteArkDrmconfiguration onByteArkPlayerItem, including the license URL and custom headers - Ads error: typically does not stop main video playback; log for analysis