# Errors Reference

When a playback error occurs, the player delivers a playbackError(player:, error:) callback through ByteArkPlayerPlaybackDelegate, or a .error notification through ByteArkPlayerPlaybackEngineNotification.

# Receiving errors via delegate

func playbackError(player: ByteArkPlayer, error: NSError) {
  print("Error \(error.code): \(error.localizedDescription)")
  // Handle the error based on error.code
}
1
2
3
4

# Error categories

Most errors are propagated from AVPlayer (the default playback engine) and fall into the following categories:

Category Description
Source error Unable to load or parse the video manifest (wrong URL, server 4xx/5xx)
Network error Network connection failed
Decoder error Device cannot decode the video/audio format
DRM error Failed to fetch the FairPlay license (Application Certificate, SPC/CKC)
Renderer error Failure while rendering the video
Unexpected error Uncategorized error

Note

For AVPlayer error code details, see AVFoundation Error Domains (opens new window).

# Errors from the Ads plugin

The Ads plugin (Google IMA SDK) delivers errors separately via ByteArkPlayerAdsPluginDelegate.adsLoaderFailed(...) or other plugin-specific callbacks — see Advertisement.

# Suggested handling

  • Source / Network error: show a user-friendly message and allow retry
  • Decoder error: verify the codec — iOS generally supports HLS/H.264/HEVC
  • DRM error: verify your ByteArkPlayerDrmDataSource implementation and the license-server response (see Apple FairPlay)
  • Ads error: typically does not stop main video playback; log for analysis