The Wowza Flowplayer Apple SDK provides the ability to track and handle errors, emitting them as events for delegates and through the NotificationCenter.
For a good user experience, you can listen to these error events and examine the error objects. You can then handle errors gracefully by implementing error-handling logic that makes your iOS or tvOS application more reliable and robust.
When working with this SDK, you can leverage the
Swift.Error error types.
AdError is a custom error type specific to ad-related issues in the Apple SDK. It's thrown for any issues triggered by ads, such as when ads are unavailable, ad loading fails, ads fail to display, or when there's an invalid ad request. This table includes ad error conditions to help with troubleshooting.
|Indicates an error during ad display.
|Indicates a failure to load an ad.
|Indicates an invalid ad request.
|Indicates no ad is available to play.
|Indicates there's no
AVPlayer instance available for playback.
IMAMetadata struct is designed to capture information related to ad playback and errors in the context of Google's Interactive Media Ads (IMA) framework.
You can use this object with error events to understand what caused an underlying advertising error. For example, to get useful metadata about a current IMA instance, combine this object with the
AdError type and pass it as an optional parameter to the
player(_:didAdFailWith:for:with:) method. The Apple SDK only returns the
IMAMetadata object when an error occurs with a particular ad.
The following table describes the properties you can use with the
|The current type of metadata.
|The current ad break time in seconds.
|The remaining ad display time in seconds.
|A boolean flag indicating if the ads were muted or not.
|The total duration of the ads in seconds.
|The error reason if an ad error occurred.
|The VAST (Video Ad Serving Template) error reason if applicable.
|The VAST error type if applicable.
|The total time required to load the ads in seconds.
PlayerError is a custom error type specific to player-related issues in the Apple SDK. It's thrown for any issues triggered by the player, such as invalid configuration, invalid access token, or general playback errors. This table includes player error conditions to help with troubleshooting.
|The player configuration is invalid.
|The access token provided for authentication is invalid.
playbackError(_ error: Error)
|An error occurred during playback. Returns a Swift.Error as its argument.
Within the Apple SDK framework, we take advantage of the native Swift way of defining and handling errors using the
Error protocol. See Swift error type for more information.