# 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}, msg=${error.msg}");
// Handle the error (show a dialog, snackbar, etc.)
},
onAdsError: (ByteArkPlayerAdsErrorData error) {
debugPrint("Ads error: ${error.msg}");
// 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 data
Both ByteArkPlayerPlaybackErrorData and ByteArkPlayerAdsErrorData expose the same two fields:
| Field | Type | Description |
|---|---|---|
code | String? | Vendor-defined error code identifying the failure |
msg | String? | Human-readable error message |
# 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