Product Updates | Contact Support | System Status
Page Contents

    Error Handling with the Native SDK for iOS

    In this topic, you will learn how the Brightcove Native SDK for iOS handles playback errors.


    Error codes have the term ErrorCode in the name. For example:


    Events have the word Event in the name. For example:


    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:

    1. If you get an error event like kBCOVPlaybackSessionLifecycleEventFail or kBCOVPlaybackSessionLifecycleEventResumeFail, check the event's properties dictionary for an @"error" key.

      This will provide an NSError object with information about the problem.

    2. 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
    3. Some errors will also have an underlying error that can be retrieved from the error object's userInfo dictionary with the NSUnderlyingErrorKey key. This will typically be a system NSError that can provide more information.

    4. To find all the error domains in the SDK, search the headers for the following:


      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
    5. To find all the error codes, search each ErrorDomain for the following:


      For example, in BCOVPlaybackSession.h, you'll see kBCOVPlaybackSessionErrorDomain with the following error codes:

      • kBCOVPlaybackSessionErrorCodeLoadFailed
      • kBCOVPlaybackSessionErrorCodeFailedToPlayToEnd
      • kBCOVPlaybackSessionErrorCodeNoPlayableSource
    6. 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 domain kBCOVPlaybackServiceErrorDomain.

    Playback errors table

    Here is a list of possible playback errors from the Native SDK for iOS. Be aware that errors can also be passed through from the underlying framework.

    iOS playback errors
    Error Description
    kBCOVFPSErrorDomain Error domain for FairPlay related errors
    kBCOVFPSErrorCodeStreamingContentKeyRequest Error occured requesting content key
    kBCOVFPSErrorCodeApplicationCertificateRequest Error occured requesting application certificate

    Page last updated on 30 Jun 2022