Dealing with iOS Mobile Errors

You need to listen for error notifications on the player object.

Note: When dealing with iOS Mobile Errors, you also need to remember to provide and display useful error messages for your app to your users.
extern NSString *const OOOoyalaPlayerErrorNotification ; 
/** Fires when an error occurs */
After an error notification is received, to determine the exact error, read the OOOoyalaError property of the player object:
/** Returns current error if it exists */
@property(readonly, nonatomic, strong) OOOoyalaError *error;

Mobile SDK for iOS Error Codes

The errors are enumerated in the header file Headers/OOOoyalaError.h and described here:

Error rawValue Description
OOOoyalaErrorCodeAuthorizationFailed 0 The authorization request failed. Example message text: “Unable to authorize access to play the video”
OOOoyalaErrorCodeAuthorizationInvalid 1 The authorization response was invalid. Example message text: “Unable to authorize access to play the video (nil).”
OOOoyalaErrorCodeHeartbeatFailed 2 The heartbeat confirmation failed. The Ooyala heartbeat request is required for some services, such as concurrent stream limits.
OOOoyalaErrorCodeContentTreeInvalid 3 The request to retrieve information about the content (closed captions, thumbnails, other metadata for the video) returned an unexpected response. Example message text: “Content Tree response invalid (nil).”
OOOoyalaErrorCodeAuthorizationSignatureInvalid 4 The signature passed in the Authorization request was invalid.
OOOoyalaErrorCodeContentTreeNextFailed 5 The request to retrieve information about the content (closed captions, thumbnails, other metadata for the video) failed.
OOOoyalaErrorCodePlaybackFailed 6 AVPlayer (used for playing the video) returned an error when attempting to play a stream. Errors include the following responses (example message text):
  • “The operation could not be completed”
  • “Current item failed to play to end time”
  • “Item playback failed”
  • “Cannot Parse”
  • “A server with the specified hostname could not be found.”
  • “Cannot Complete Action”
  • “Could not play the content”
  • “The operation couldn’t be completed. (CoreMediaErrorDomain error -12645 - Can not proceed after removing variant)”
OOOoyalaErrorCodeAssetNotEncodedForIOS 7 The video stream is not compatible with formats playable on iOS devices. Example message text: “The current item is not encoded for iOS.”
OOOoyalaErrorCodeInternalIOS 8 This is an internal iOS Error. Check the error property.
OOOoyalaErrorCodeMetadataInvalid 9 The request for metadata related to the video returned an invalid response. Example message text: “Failed to retrieve metadata.”
OOOoyalaErrorCodeDeviceInvalidAuthToken 10 An error occurred during DRM rights acquisition. Indicates an invalid rights server token.
OOOoyalaErrorCodeDeviceLimitReached 11 An error occurred during DRM rights acquisition. Indicates a server report that the device limit has been reached for the user. A device will need to be unbound by either the end-user or the customer for the end-user’s unique ID.
OOOoyalaErrorCodeDeviceBindingFailed 12 The API that binds a device to the user ID failed. This could happen for a number of reasons (e.g. no unique ID provided with the API request, some internal API failure, etc.).
OOOoyalaErrorCodeDeviceIdTooLong 13 An error occurred during DRM rights acquisition. Indicates a server report that the device id has too many characters (overflows in the database).
OOOoyalaErrorCodeDeviceGenericDrmError 14 An error occurred during DRM rights acquisition. Indicates an unknown error has occurred during the DRM workflow.
OOOoyalaErrorCodeDrmDownloadFailedError 15 An error occurred during DRM rights acquisition. Indicates that a required file failed to download.
OOOoyalaErrorCodeDrmPersonalizationFailedError 16 An error occurred during DRM rights acquisition. Indicates that device personalization failed to complete.
OOOoyalaErrorCodeDrmAcquireRightsFailedError 17 An error occurred during DRM rights acquisition. Indicates that asset rights acquisition failed.
OOOoyalaErrorCodeDiscoveryInvalidParameter 18 The expected Discovery API (recommendation engine) parameters were not provided or were invalid.
OOOoyalaErrorCodeDiscoveryNetworkError 19 The Discovery API (recommendation engine) response was not received due to a network error.
OOOoyalaErrorCodeDiscoveryFailedResponse 20 The Discovery response was received, but an error occurred so that the response was not received.
OOOoyalaErrorCodeNoAvailableStreams 21 Indicates that the asset embed code is not currently mapped to any video streams.
OOOoyalaErrorCodePcodeMismatch 22 The asset embed code does not belong to the pcode (aka API key) associated with that asset embed code. Asset embed codes should be associated with the pcode/API key for the account to authorize playback.
OOOoyalaErrorCodeDownloadFailed 23 The attempt to download the stream for offline playback failed to complete.
OOOoyalaErrorCodeDeviceConcurrentStreams 24 When attempting to play back the stream, it was found that the same user ID currently already has the maximum number of concurrent streams running.
OOOoyalaErrorCodeAdvertistingIdFailure 25 The request for an Ad failed.
OOOoyalaErrorCodeDiscoveryGetFailure 26 The GET request for recommended videos (Discovery API) failed.
OOOoyalaErrorCodeDiscoveryPostFailure 27 The POST request to the Discovery API failed.
OOOoyalaErrorCodeUnknownError 28 The request for a stream associated with the asset embed code returned an unknown error.

Authorization Error Codes

You can examine the field authCode on your player object's current item (player.currentItem.authCode) for possible errors.

Error Code
AUTHORIZED 0
UNAUTHORIZED_PARENT 1
UNAUTHORIZED_DOMAIN 2
UNAUTHORIZED_LOCATION 3
BEFORE_FLIGHT_TIME 4
AFTER_FLIGHT_TIME 5
OUTSIDE_RECURRING_FLIGHT_TIMES 6
BAD_EMBED_CODE 7
INVALID_SIGNATURE 8
MISSING_PARAMS 9
MISSING_RULE_SET 10
UNAUTHORIZED 11
MISSING_PCODE 12
UNAUTHORIZED_DEVICE 13
INVALID_TOKEN 14
TOKEN_EXPIRED 15
UNAUTHORIZED_MULTI_SYND_GROUP 16
PROVIDER_DELETED 17
TOO_MANY_ACTIVE_STREAMS 18
MISSING_ACCOUNT_ID 19
NO_ENTITLEMENTS_FOUND 20
NON_ENTITLED_DEVICE 21
NON_REGISTERED_DEVICE 22

해당 내용이 도움 되었습니까?