Initialize / Configure 3rd-party Player on Desktop - ActionScript

The following libraries and configuration data are required; obtain these from your Adobe representative:
  • Required Adobe Video Tracking Libraries:
    • AppMeasurement.swc - Contains the low-level data collection core logic. This is where the tracking data is accumulated and sent over the network.
    • VideoHeartbeat.swc - Contains a series of helper classes that greatly reduce the integration effort, as well as the amount of code needed to implement video tracking in the player.
    • VisitorAPI.swc - Uniquely labels the user of the web page hosting the video player. (This is required only for Desktop apps (ActionScript and JavaScript.)
  • Required Configuration / Initialization Data:
    • 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
    • Visitor Tracking Server Endpoint - The URL of the endpoint that provides the unique "label" for the current user
    • Visitor namespace - A string value required for instantiating the Visitor component
    • Job ID - This is the processing job identifier. It is an indicator for the back-end endpoint 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 how to initialize and configure the video heartbeat library and its associated video tracking components. These components must be instantiated and configured at the application level, in the order given here:
  1. Instantiate and configure the VisitorAPI library.
  2. Create an instance of the AppMeasurement library. This instance must aggregate the VisitorAPI instance.
  3. Create the video heartbeat library which in turn aggregates the AppMeasurement instance created during the previous step.
In summary, the application developer is in charge of instantiating all of the video tracking components while managing this dependency chain: VisitorAPI -> AppMeasurement -> video heartbeat.
  1. Instantiate and configure the VisitorAPI component:
    // Instantiation
    var visitor:Visitor = new Visitor("Visitor Nmespace");  // Provided by Adobe
     
    // Configuration
    visitor.trackingServer = "Visitor tracking server URL";

    Instantiating the Visitor API component requires an input namespace parameter (provided in advance by Adobe). This is a pure string value.

    There is only one configuration option available for the VisitorAPI component -- the URL of the back-end endpoint that provides the unique "label" for the current user.

  2. Instantiate and configure the AppMeasurement component:
    // Instantiation
    var appMeasurementObject:AppMeasurement = new AppMeasurement();
    appMeasurementObject.account = "Account name";
     
    // Use the same namespace value you used for the Visitor API component.
    appMeasurementObject.visitorNamespace = "Visitor namespace";
    
    // This is the Adobe Analytics endpoint
    appMeasurementObject.trackingServer = "Adobe Analytics tracking server URL";
     
    // Attach the VisitorAPI to the AppMeasurement instance.
    appMeasurementObject.visitor = visitor;
    There are many configuration options available on the AppMeasurement instance that are not shown here. (See the Adobe Analytics Developer page for more configuration options.) The three options shown in the sample code above are required (account, visitorNamespace, trackingServer). These values are provided in advance by Adobe.

    It is important to properly set up the dependency chain: the AppMeasurement instance aggregates (depends on) the Visitor API component.

  3. Instantiate and configure the video heartbeat component. Instantiating the video heartbeat component is a two step process, due to its dependency on these two components:
    • The AppMeasurement component
    • An implementation of the IVideoHeartbeatPlayerDelegate interface

    It is the responsibility of the video player developer to implement and instantiate the IVideoHeartbeatPlayerDelegate interface. Once this implementation is in place, the instantiation process is very straightforward:

    Instantiate the video heartbeat component:
    // Here, the CustomPlayerDelegate class implements the IVideoHeartbeatPlayerDelegate 
    // interface.
    var playerDelegate:CustomPlayerDelegate = new CustomPlayerDelegate();
     
    // We now have all required ingredients to instantiate the video heartbeat library.
    var videoHeartbeat:VideoHeartbeat = new VideoHeartbeat(appMeasurementObject, playerDelegate);
    Configure the newly created video heartbeat instance:
    // Instantiate the configuration object.
    var heartbeatConfig:VideoHeartbeatConfigData = new VideoHeartbeatConfigData();
     
    heartbeatConfig.playerName = "The name of your player app";
    heartbeatConfig.trackingServer = "video heartbeat tracking server URL here";
    heartbeatConfig.jobId = "Job-ID";
    heartbeatConfig.publisher = "Publisher name";
    heartbeatConfig.ovp = "The name of the online video platform (e.g., youtube)";
    heartbeatConfig.sdk = "The version of your video player";
     
    // Set debugLogging to "true" to activate debug tracing
    // Set debugLogging to "false" for deployment to the production environment
    heartbeatConfig.debugLogging = false; // (the default) 
     
    // ==> Explicitly activate the video heartbeat functionality. <==
    heartbeatConfig.enableHeartbeat = true;
     
    videoHeartbeat.config(heartbeatConfig);
    Important: In the code sample above, notice the explicit activation of the heartbeat tracking functionality. The application developer must set the enableHeartbeat flag to true inside the configuration object. If this step is omitted, no video heartbeat calls will be sent over the network.
    Note: Setting the debugLogging flag to true activates extensive tracing messaging, which may impact performance, and may significantly increase the attack surface. While tracing is useful during development and debugging efforts, the application developer must set this flag to false for the production version of the player app. The logging mechanism is disabled by default.