AI-generated Key Takeaways
- 
          IMAErrorCode is an enumeration that lists possible error codes raised while loading or playing ads. 
- 
          Errors can occur due to malformed VAST responses, trafficking issues, load timeouts, too many redirects, or invalid URLs. 
- 
          Issues with video ad playback, media loading, or mismatched assets can also trigger errors. 
- 
          Errors related to companion ads, unknown problems, playlist malformed responses, or failed ad requests are also defined. 
- 
          Other potential errors include required listeners not being added, missing VAST assets, ad slots not being visible, empty VAST responses, failed ad loading, or stream initialization failures. 
- 
          API usage errors like invalid arguments, generic API errors, or an old OS runtime can also occur. 
- 
          Finally, errors can be related to the video element being used by another manager or being required but not specified, or the content playhead missing. 
IMAErrorCode
enum IMAErrorCode : NSInteger {}Possible error codes raised while loading or playing ads.
- 
                  
                  The ad response was not recognized as a valid VAST ad. DeclarationSwift case VAST_MALFORMED_RESPONSE = 100Objective-C kIMAError_VAST_MALFORMED_RESPONSE = 100
- 
                  
                  Trafficking error. Video player received an ad type that it was not expecting and/or cannot display. DeclarationSwift case VAST_TRAFFICKING_ERROR = 200Objective-C kIMAError_VAST_TRAFFICKING_ERROR = 200
- 
                  
                  The VAST URI provided, or a VAST URI provided in a subsequent Wrapper element, was either unavailable or reached a timeout, as defined by the video player. The timeout is 8 seconds for initial VAST requests and 4 seconds for each subsequent Wrapper. DeclarationSwift case VAST_LOAD_TIMEOUT = 301Objective-C kIMAError_VAST_LOAD_TIMEOUT = 301
- 
                  
                  The maximum number of VAST wrapper redirects has been reached. DeclarationSwift case VAST_TOO_MANY_REDIRECTS = 302Objective-C kIMAError_VAST_TOO_MANY_REDIRECTS = 302
- 
                  
                  At least one VAST wrapper loaded and a subsequent wrapper or inline ad load has resulted in a 404 response code. DeclarationSwift case VAST_INVALID_URL = 303Objective-C kIMAError_VAST_INVALID_URL = 303
- 
                  
                  There was an error playing the video ad. DeclarationSwift case VIDEO_PLAY_ERROR = 400Objective-C kIMAError_VIDEO_PLAY_ERROR = 400
- 
                  
                  Failed to load media assets from a VAST response. The default timeout for media loading is 8 seconds. DeclarationSwift case VAST_MEDIA_LOAD_TIMEOUT = 402Objective-C kIMAError_VAST_MEDIA_LOAD_TIMEOUT = 402
- 
                  
                  Assets were found in the VAST ad response for linear ad, but none of them matched the video player’s capabilities. DeclarationSwift case VAST_LINEAR_ASSET_MISMATCH = 403Objective-C kIMAError_VAST_LINEAR_ASSET_MISMATCH = 403
- 
                  
                  A companion ad failed to load or render. DeclarationSwift case COMPANION_AD_LOADING_FAILED = 603Objective-C kIMAError_COMPANION_AD_LOADING_FAILED = 603
- 
                  
                  An unexpected error occurred and the cause is not known. Refer to the inner error for more information. DeclarationSwift case UNKNOWN_ERROR = 900Objective-C kIMAError_UNKNOWN_ERROR = 900
- 
                  
                  Ads list response was malformed. DeclarationSwift case PLAYLIST_MALFORMED_RESPONSE = 1004Objective-C kIMAError_PLAYLIST_MALFORMED_RESPONSE = 1004
- 
                  
                  There was a problem requesting ads from the server. DeclarationSwift case FAILED_TO_REQUEST_ADS = 1005Objective-C kIMAError_FAILED_TO_REQUEST_ADS = 1005
- 
                  
                  Listener for at least one of the required vast events was not added. DeclarationSwift case REQUIRED_LISTENERS_NOT_ADDED = 1006Objective-C kIMAError_REQUIRED_LISTENERS_NOT_ADDED = 1006
- 
                  
                  No assets were found in the VAST ad response. DeclarationSwift case VAST_ASSET_NOT_FOUND = 1007Objective-C kIMAError_VAST_ASSET_NOT_FOUND = 1007
- 
                  
                  The ad slot is not visible on the page. DeclarationSwift case ADSLOT_NOT_VISIBLE = 1008Objective-C kIMAError_ADSLOT_NOT_VISIBLE = 1008
- 
                  
                  A VAST response containing a single <VAST>tag with no child tags.DeclarationSwift case VAST_EMPTY_RESPONSE = 1009Objective-C kIMAError_VAST_EMPTY_RESPONSE = 1009
- 
                  
                  There was an error loading the ad. DeclarationSwift case FAILED_LOADING_AD = 1010Objective-C kIMAError_FAILED_LOADING_AD = 1010
- 
                  
                  There was an error initializing the stream. DeclarationSwift case STREAM_INITIALIZATION_FAILED = 1020Objective-C kIMAError_STREAM_INITIALIZATION_FAILED = 1020
- 
                  
                  Invalid arguments were provided to SDK methods. DeclarationSwift case INVALID_ARGUMENTS = 1101Objective-C kIMAError_INVALID_ARGUMENTS = 1101
- 
                  
                  Generic invalid usage of the API. DeclarationSwift case API_ERROR = 1102Objective-C kIMAError_API_ERROR = 1102
- 
                  
                  The version of the runtime is too old. DeclarationSwift case OS_RUNTIME_TOO_OLD = 1103Objective-C kIMAError_OS_RUNTIME_TOO_OLD = 1103
- 
                  
                  Another VideoAdsManager is still using the video. It must be unloaded before another ad can play on the same element. DeclarationSwift case VIDEO_ELEMENT_USED = 1201Objective-C kIMAError_VIDEO_ELEMENT_USED = 1201
- 
                  
                  A video element was not specified where it was required. DeclarationSwift case VIDEO_ELEMENT_REQUIRED = 1202Objective-C kIMAError_VIDEO_ELEMENT_REQUIRED = 1202
- 
                  
                  Content playhead was not passed in, but list of ads has been returned from the server. DeclarationSwift case CONTENT_PLAYHEAD_MISSING = 1205Objective-C kIMAError_CONTENT_PLAYHEAD_MISSING = 1205