Overview
Error codes have the term ErrorCode
in the name. For example:
kBCOVPlaybackSessionErrorCodeLoadFailed
Events have the word Event
in the name. For example:
kBCOVPlaybackSessionLifecycleEventFail
Playback errors
Playback errors are handled through events. Generally speaking you would receive playback errors using the lifecycle event delegate callback on the BCOVPlaybackController
:
- (void)playbackSession:(id<BCOVPlaybackSession>)session
didReceiveLifecycleEvent:(BCOVPlaybackSessionLifecycleEvent *)lifecycleEvent
To get further information, do the following:
-
If you get an error event like
kBCOVPlaybackSessionLifecycleEventFail
orkBCOVPlaybackSessionLifecycleEventResumeFail
, check the event'sproperties
dictionary for an@"error"
key.This will provide an
NSError
object with information about the problem. -
Each
NSError
will have an error domain, like the following:NSCocoaErrorDomain
kBCOVPlaybackSessionErrorDomain
Each error domain will have an associated error code and error description, like the following:
kBCOVPlaybackSessionErrorCodeLoadFailed
kBCOVPlaybackSessionErrorCodeNoPlayableSource
-
Some errors will also have an underlying error that can be retrieved from the error object's
userInfo
dictionary with theNSUnderlyingErrorKey
key. This will typically be a systemNSError
that can provide more information. -
To find all the error domains in the SDK, search the headers for the following:
ErrorDomain
Here is a list of headers that have
ErrorDomain
references:BCOVFPSAuthorizationProxy.h
BCOVFPSBrightcoveAuthProxy.h
BCOVOfflineVideoManager.h
BCOVOnceCommon.h
BCOVOnceONOXMLDocument.h
BCOVOUXConstants.h
BCOVPlaybackService.h
BCOVPlaybackSession.h
-
To find all the error codes, search each
ErrorDomain
for the following:ErrorCode
For example, in
BCOVPlaybackSession.h
, you'll seekBCOVPlaybackSessionErrorDomain
with the following error codes:kBCOVPlaybackSessionErrorCodeLoadFailed
kBCOVPlaybackSessionErrorCodeFailedToPlayToEnd
kBCOVPlaybackSessionErrorCodeNoPlayableSource
-
Other domains may return errors differently. For example, the
BCOVPlaybackService
object will return errors in its completion blocks if there are network errors when requesting videos from the online catalog. It uses the error domainkBCOVPlaybackServiceErrorDomain
.