Initialize / Configure 3rd-party Player on iOS

The following libraries and configuration data are required; obtain these from your Adobe representative:
  • Required Adobe Video Tracking Libraries:
    • AppMeasurement library AdobeMobileLibrary.a/ADBMobile.h - Contains the low-level data collection core logic. This is where the video heartbeat data is accumulated and sent over the network.
    • video heartbeat library VideoHeartbeat.a/ADBVideoHeartbeat.h - Contains the video-heartbeat data collection core logic. This is where all the real-time video tracking takes place. The video heartbeat library uses the AppMeasurement module in the sense that it needs access to a subset of its APIs and delegates some work to it.
    Note: For the iOS implementation these are the only libraries that the application developer needs. In contrast to the Desktop implementations (AS and JS), the VisitorAPI functionality is included in the AppMeasurement library itself.
  • Required Configuration / Initialization Data:
    • ADBMobileConfig.json - It is crucial that the name and the path of the configuration file remain unchanged. The JSON config file MUST be ADBMobileConfig.json. The path to this file MUST be <source root>/AdobeMobile.
    • AppMeasurement tracking server endpoint - The URL of the endpoint where all of the AppMeasurement tracking calls are sent
    • video heartbeat tracking server endpoint - The URL of the endpoint where all of the video heartbeat tracking calls are sent
    • Job ID - This is the processing job identifier. It is an indicator for the back-end end-point about what kind of processing should be applied for the video-tracking calls.
    • Publisher Name - This is the name of the content publisher.
    • Account Name - Also known as the Report Suite ID (RSID)

The following procedure describes the steps required to implement real-time video tracking in your player using the video heartbeat library. For the iOS implementation, the lifecycle of the AppMeasurement library is not in the hands of the application developer. The AppMeasurement library is instantiated automatically at application load time, and is made available as a globally accessible singleton. So, the application developer is only concerned with the instantiation of the video heartbeat library, which obtains a reference to the AppMeasurement instance behind the scenes. This is in contrast with the Desktop (AS/JS) clients, where the application developer is required to explicitly resolve the dependency chain between the video heartbeat and AppMeasurement libraries.

  1. Instantiate the video heartbeat library. Instantiating the video heartbeat library is a two-step process. The video heartbeat instance must aggregate an implementation of the ADBVideoHeartbeatPlayerDelegate protocol. It is the responsibility of the video player developer to implement and instantiate this protocol:
    #import "ADBVideoHeartbeat.h"
     
    // The CustomPlayerDelegate class implements the ADBVideoHeartbeatPlayerDelegate protocol.
    CustomPlayerDelegate *playerDelegate = [[CustomPlayerDelegate alloc] init];
     
    ADBVideoHeartbeat *videoHeartbeat = [[ADBVideoHeartbeat alloc] initWithPlayerDelegate:playerDelegate];
  2. Set load time options in the ADBMobileConfig.json resource file.
    Most of the configuration options are captured inside a JSON-formatted configuration file. (A limited number of options are available at run-time through API calls.) The config file must be bundled with the application itself as a resource file. This resource file is scanned only once at application load time. Once these values are read from the configuration file, they remain constant throughout the lifecycle of the whole application. Thus the configuration steps are as follows:
    1. Fill in the JSON config file (ADBMobileConfig.json) with the appropriate values.
    2. Place this file into the AdobeMobile folder. This folder must be in the root of your application source tree.
    3. Compile and build the final application
    4. Deploy and run the bundled application
    {
        "version" : "1.1",
        "analytics" : {
            "rsids" : "adobedevelopment",
            "server" : "10.131.129.149:3000",
            "charset" : "UTF-8",
            "ssl" : false,
            "offlineEnabled" : false,
            "lifecycleTimeout" : 5,
            "batchLimit" : 50,
            "privacyDefault" : "optedin",
            "poi" : []
        },
        "target" : {
            "clientCode" : "",
            "timeout" : 5
        },
        "audienceManager" : {
            "server" : ""
        }
    }

    The AppMeasurement-specific configuration settings are outside the scope of this document. For information on those settings, see Measuring Video in Adobe Analytics.

  3. Configure the video heartbeat module.

    Sample video heartbeat configuration:

    vhbConfig = [[ADB_VHB_ConfigData alloc] 
        initWithPlayerName:@"the name of your player app"
        andTrackingServer:@"some URL here"
        andJobId:@"some JOB-ID here"
        andPublisher:@"some publisher here"];
     
    [vhbConfig setChannel:@"example channel"];
    [vhbConfig setOvp:@"example ovp];
    [vhbConfig setSdk:@"example sdk version"];
     
    // Set this to true to activate the debug tracing
    [vhbConfig setDebugLogging:YES];
     
    // Set this to true to log the URLs of the output HTTP calls.
    [vhbConfig setDebugTracking:YES];
     
    // Setting this to YES activates the "quiet" mode.
    [vhbConfig setTrackLocal:NO];
     
    // Explicitly activate the video heartbeat functionality.
    [vhbConfig setEnableHeartbeat:YES];
     
    [videoHeartbeat config:vhbConfig];

    The video heartbeat configuration follows the builder pattern: a configuration object is built (an instance of the ADB_VHB_ConfigData class). The configuration object is passed as an input parameter to the config selector exposed by the video heartbeat instance.

    There are two types of configuration parameters that can be set on the configuration object:
    • Mandatory configuration parameters. This set of parameters are provided as input arguments to the constructor method of the ConfigData class. Below is a description of these parameters in order:
      • Player app name - The name of your player application. Any string can be provided here.
      • URL of the tracking end-point - This is where all of the video-heartbeat calls are sent. This value is provided by Adobe in advance.
      • jobId - This is the processing job identifier. It is an indicator for the back-end end-point about what kind of processing should be applied for the video-tracking calls. This value is provided by Adobe in advance.
      • publisher - This is the name of the content publisher. This value is provided by Adobe in advance.
    • Optional configuration parameters. These parameters are provided as publicly accessible instance variables on the ConfigData class. Below is a summary of the available properties:
      • channel - This is the name of the distribution channel. Any string can be provided here.
      • ovp - This is the name if the Online Video Platform through which the content gets distributed. (For example: YouTube.) It can be any arbitrary string.
      • sdk - This is the version string of the video-player app. It can be any arbitrary string.
    Important: Observe (in the code sample above) the explicit activation of the heartbeat video tracking functionality ( [vhbConfig setEnableHeartbeat:YES];). The application developer must set the enableHeartbeat flag to true inside the configuration object. If this step is omitted, no heartbeat calls will be sent over the network; instead, the legacy "milestone" tracking provided by the AppMeasurement library will be used.
    Note:
    • Setting the debugLogging flag to true activates extensive tracing messaging, which may impact performance. While tracing is useful during development and debugging efforts, the application developer must set this to false for the production version of the player app. The logging mechanism is disabled by default.
    • Setting the trackLocal flag to true activates "quiet" mode. In this mode, no network calls are sent over the network at all. You can use this mode in conjunction with setting debugTracking to true. In this scenario, the developer gets to see the HTTP calls in the trace console without actually sending anything over the wire.
  4. Tear down the video heartbeat instance. The integration engineer is responsible for manually and explicitly managing the lifecycle of the video heartbeat instance. As a result, the ADB_VHB_VideoHeartbeatProtocol protocol also provides a destroy selector that allows for the execution of various tear-down operations (including de-allocating internal resources):
    [videoHeartbeat destroy];