Conviva C Sensor Integration

Explains how to install and integrate the Conviva sensor in C-based applications to collect video streaming experience data.

Updated 2026-08-03 stream, sensor, sensor developer center, sensor integration, c

Conviva DPI Sensor Integration

Conviva DPI Sensor Installation and Integration

Low-code integration of Conviva DPI sensor enables automatic, and semantic-less data collection. For more details to help get started with DPI integration, see DPI Integration FAQs.

Add Conviva library and headers

Download the C SDK library: C SDK downloads page.

Include the following header required for integration:

#include <app_tracker.h>

Initialize Conviva C-SDK Client

To initialize the Conviva C Client, refer to the 1. Install Conviva Library section of Conviva DPI Sensor Integration.

Start DPI Reporting

To start the ConvivaDPI tracker, call the start tracker API:

  • app_name - application name; mandatory input

  • user_id - user identifier or name (if available at the time of starting the tracker)

snprintf(app_name, CCL_MAX_APP_NAME_LENGTH,"%s", "your_application_name_of_choice"); // mandatory field
snprintf(user_id, CCL_MAX_USER_ID_LENGTH,"%s", "logged_in_user_id_or_device_id");
cat_start_tracker(char* app_name, char* user_id);

Set User ID

Set the application user ID after initialization:

char *user_id;
user_id = strdup("Enter your UserID Here");
cat_set_user_id(user_id);
free(user_id);

Set Application Info

Set the application info after creating the tracker:

cat_app_info_t app_info;
// Set the optional parameters based on availability
app_info.app_load_start = 1752035360399; // Application Load Start time in seconds
app_info.app_load_end =  1752035360401; // Application Load End time in seconds
//Set the mandatory parameters after the tracker creation
sprintf(app_info.app_build, "%s", “1.2.0.1”);
sprintf(app_info.app_version, "%s", “v2.0”);

cat_set_application_info(&app_info);
Check the memory ownership-related detailed information in the App Sensor API documents.

Manage Custom Tags

Manage custom tags by using the following APIs:

  • cat_set_custom_tags()

  • cat_clear_custom_tags()

  • cat_clear_all_custom_tags()

// Set custom tags
ccl_dictionary_t *app_tags = ccl_dictionary_create();
ccl_dictionary_put (app_tags, “key1”, “value1”);
ccl_dictionary_put (app_tags, “key2”, “value2”);
cat_set_custom_tags(app_tags);

//Clear specific custom tags with keys
char *str = strdup("key1");

//clear the custom tag with key as “key1”
cat_clear_custom_tags(&str, 1); // list of keys and number of keys

//Clear all custom tags
cat_clear_all_custom_tags();
Check the memory ownership-related detailed information in the App Sensor API documents.

Report Application Install Event

Reports the app install event, only for the fresh installation of the app.

cat_track_app_install();

Report Custom Events

Track custom App events specific to your applications by calling the cat_send_custom_event API when DPI is enabled:

ccl_dictionary_put (dic, "key1", "value1");
ccl_dictionary_put (dic, "key2", "value2");
cat_send_custom_event ("CustomEvent1", dic);
ccl_dictionary_destroy (dic);
Order of the dictionary entries may vary.

Report Screen View

This C-SDK library allows you to track screen view events of your applications by calling the cat_track_screen_view API, when DPI is enabled:

cat_screen_info_t screen;
memset(&screen, 0, sizeof(cat_screen_info_t));
screen.screen_name =strdup(“some name”);
screen.screen_type = strdup(“some_type”);
screen.load_start = 1752035360399;
screen.load_end = 1752035360401;
cat_track_screen_view (&screen);

This API shows screen_info, which includes one mandatory argument that tells the screen name/title and few optional arguments. This API tracks the time taken to load each screens by providing the start and end times in milliseconds (ms).

Check the memory ownership-related detailed information in the App Sensor API documents.

Report Network Request

This C-SDK library allows you to track the network events of your applications by calling the cat_track_network_request API, when DPI is enabled:

cat_network_request_info_t nw_info;
memset(&nw_info, 0, sizeof(cat_network_request_info_t));
// target url – mandatory input
strcpy(nw_info.target_url, "test_url_1.com");
// method – mandatory input
strcpy(nw_info.method, "post");
// timestamps -> mandatory inputs, with valid timestamps in milliseconds
nw_info.request_timestamp = 1729745074745; 
nw_info.response_timestamp = 1729745074760;
// response status code – 0 will takes place if no valid value is set.
nw_info.response_code = 200;
cat_track_network_request(&nw_info);

Pause and Resume Tracker

This C-SDK library allows you to pause and resume the tracking of all events by calling the cat_pause_tracker and cat_resume_tracker APIs.

During the paused state, DPI tracker does not track any events.
// pause the tracker when needed.
cat_pause_tracker();
// resume the tracker when needed.
cat_resume_tracker();

Report ANR Start Events

Use the cat_track_anr API to tracks of Application Not Responding (ANR) events. The API reports all unrecovered ANRs, including relevant details such as start_time and reason:

cat_anr_info_t anr_info;
memset(&anr_info, 0, sizeof(cat_anr_info_t));
// Mandatory parameter
anr_info.anr_start = 1752035360401;
// Optional
anr_info.anr_reason = strdup("reason for ANR");

cat_track_anr(&anr_info);
Check the memory ownership-related detailed information in the App Sensor API documents.

Report Application Error Events

Use the cat_track_application_error API to track application error events, with variety of information, and uses error_message and error_language are mandatory fields.

cat_app_error_info_t app_error;
memset(&app_error,0, sizeof(cat_app_error_info_t));
app_error.error_lang = CAT_ERROR_LANG_C;
app_error.error_msg = strdup(“Error inside carousel access”);

cat_track_application_error(&app_error);
Check the memory ownership-related detailed information in the App Sensor API documents.

Stop DPI Reporting

Use the following API to cleanup and stop the DPI tracker.

cat_stop_tracker();

Download C SDK for DPI sensor Integration.

Conviva Video Sensor Integration

Follow these instructions to complete the Conviva VSI Sensor integration on C players.

Step 1: Install Conviva Library

  • Install the Conviva library and headers.

  • Initialize the main Conviva object.

  • Implement platform interface and device metadata.

Developer Steps

  • Install the Conviva library and add headers.

  • Initialize the library by calling ccl_init(CUSTOMER_KEY, platform_interface, settings) using your CUSTOMER_KEY.

Step 2: Configure Metadata

  • Most metadata is autocollected.

  • Configure additional custom metadata tags (if applicable).

Developers Steps

  • Use the pre-defined metadata key/value pairs.

  • Optionally, set custom metadata.

Step 3: Report Events and Metadata

  • Use Conviva methods to report video stream events and metadata. Conviva computes stream data and metrics.

Developer Steps

  • Use ccl_session_create(content_info) method to report playback attempt request along with metadata (content, workflow, audience, and other relevant metadata). For ads, start monitoring by calling ccl_ad_session_create(video_session, ad_content_info) for each ad in the ad break. Use the ccl_session_destroy(session) method to report the of end playback

  • Use ccl_player_t as a callback container object to report video related events and ad related events.

Step 4: Handle User Actions

Use Conviva methods to handle user actions, such as backgrounding and foregrounding.

Use Conviva methods to report custom events.

Use Conviva methods to control data collection and delete collected data.

Developer Steps

  • Set the player state to paused for background events.

  • Continue to report player state changes or metrics for foreground events.

  • Report video related events and application-level events.

  • Manage Data Collection and User Preferences.

Step 5: Clean Up Session

  • Use Conviva release methods to clean up objects on player application exit.

Developer Steps

  • On application exit, call ccl_cleanup();

Prerequisites

  • Obtain your account's CUSTOMER_KEYs.**Conviva provides a test account and a production account for Test and Production environments, respectively. You can find your CUSTOMER_KEY here: Pulse - Account Info. Ask your Conviva representative for assistance if you have problems accessing it.

  • Pass the gatewayUrl parameter to init() method of Conviva SDK. The gatewayUrl is specific for your account and shall ONLY be used for tests, never for production deployment.

    Sample gatewayUrl for Testing:

    https://<*customer_key*>.ts-testonly.conviva.com

    IMPORTANT: If there's any doubt on how to set the gateway URL, consult your Conviva representative - this is a critical parameter. For production, Conviva library uses the automatically-assigned gatewayUrl.

    Use Touchstone 2.0 in Pulse to perform self-validation and debugging of video sensor integration

  • For Conviva JavaScript Sensor Integration, you can use any custom gateway URL with a proxy service setup. This is applicable for JavaScript version 4.7.13 onwards.

  • Plan your metadata

    Conviva supports Pre-defined, Device, and Custom metadata. Work with your project team to determine the need to collect any custom metadata. It's also recommended to work with your Conviva representative to create your metadata plan prior to integration.

  • Integration Summary

    1. Install Conviva Library
    • Install the library and add dependencies.

    • Implement the platform interface.

    • Implement device metadata as part of the platform interface.

    • Initialize the library by calling ccl_init(CUSTOMER_KEY, platform_interface, settings) using your CUSTOMER_KEY.

    1. Configure Metadata
    • Implement the metadata by following the instructions to use the pre-defined keys, as well as custom metadata, if applicable.
    • Report ad break start / end.
    • Implement ad metadata, events and metric reporting (if applicable).
    1. Report Events and Metadata
    • Start monitoring session by calling ccl_session_create(content_info) method to report playback attempt request along with metadata (content, workflow, audience, and other relevant metadata). For the ads, start monitoring by calling ccl_ad_session_create(video_session, ad_content_info) for each ad in the ad break.
    • Use the ccl_session_destroy(session) method to report the of end playback.
    • Create an instance of ccl_player_t as a callback container object to report video related events.
    • If your player has ads: create an instance of ccl_player_t for ads as a callback container object to report ad related events (if the ad player is different than video player).
    • Implement start_monitoring() callback to retrieve the ccl_notifier_t object. Record the object for future use to report metrics.
    • Implement metric reporting via ccl_player_t callbacks and ccl_notifier_t methods for both video and ads (if applicable).
    1. Handle User Actions
    • Handle user actions such as backgrounding, user dialogue, pin popup according to the specification.

    • Report network_metrics.

    1. Clean Up
    • Call ccl_cleanup() to cleanup Conviva library and release memory / resources.

    Test and Validate

    1. After integration, perform a sanity check following the test cases in the Stream Sensor Sanity Test Plans spreadsheet. For the full validation test, use the test cases in the Stream Sensor Full Test Plans spreadsheet.

    2. Use Touchstone in Pulse to perform self-validation and debugging of video sensor integration.

    Be sure to replace your TEST CUSTOMER_KEY with the PRODUCTION key to go live with your application, and generate the session traffic to the following Touchstone gateway URL:https://.ts-testonly.conviva.com
    1. Done! Analyse your data in Pulse and improve your viewer experience - let's make video experience better!

    API Reference Documentation

    The Conviva C SDK includes Reference Documentation for video and DPI sensor APIs.

    Sample Application

    The sample application illustrating Conviva integration example can be found along with the library, in the same .zip file. Please refer to the next step below for details.

    1. Install Conviva Library

    Add Conviva Library and Implement Platform Interface

    Add Conviva library and headers

    Download the C SDK library: C SDK downloads page.

    Include the following header required for integration:

    #include <ccl.h>
    

    Initialize the Conviva C Client object

    int ccl_init (const char * 	customer_key, const ccl_platform_t * platform_interface,
                  const ccl_settings_t * settings)
    
    • customer_key: String to identify specific customer account. Different keys shall be used for development / debug versus production environment. Find your keys on the account info page in Pulse;

    • platform_interface: Your implementation of ccl_platform_t for your device. Refer to the next section here for details of the platform interface implementation.

  • settings: Custom settings for the library. The allowed parameters are:
    • gateway_url [CCL_MAX_URL_LENGTH]: once enabled, the data will appear in Pulse for performing self-validation of video sensor integration. For more information, see Self-validation using Touchstone 2.0.
    • ccl_log_level_t log_level: set to CCL_LOG_LEVEL_DEBUG for debug-level log verbosity.

    IMPORTANT: No need to set gateway_url and log_level settings for your production release explicitly. The Conviva sensor has the right default value.Sample code illustrating initialization with/without debug:

    /* platform must be available throughout the SDK life cycle: */
     
      ccl_platform_t platform = {
          save_data,
          load_data,
          http_post_request,
          console_log,
          epoch_time_ms,
          get_platform_metadata,
          create_timer,
          destroy_timer,
          rand,
          mutex_init,
          mutex_lock,
          mutex_unlock,
          mutex_destroy,
          rwlock_init,
          rwlock_rdlock,
          rwlock_wrlock,
          rwlock_unlock,
          rwlock_destroy,
          mem_alloc,
          mem_free
          NULL, // base64_encode - optional
          NULL, // generate_hash - optional
          generate_uuid,
          http_get_request
      };
     
      #ifdef DEBUG
    const char *customer_key = "REPLACE_ME_BY_YOUR_TEST__CUSTOMER_KEY";
    const char *gatewayUrl = "YOUR Touchstone Service URL";
    #else
    const char *customer_key = "REPLACE_ME_BY_YOUR_PRODUCTION_CUSTOMER_KEY>";
    #endif
     
    ccl_settings_t *settings = (ccl_settings_t *) mem_alloc(sizeof(ccl_settings_t));
    ccl_settings_create(settings);
     
    #ifdef DEBUG
    strncpy(settings->gateway_url, gatewayUrl, CCL_MAX_URL_LENGTH);
    settings->log_level = CCL_LOG_LEVEL_DEBUG;
    #endif
    ccl_init(customer_key, &platform, settings);
     
    /* Settings can be destroyed immediately after the initialization: */
    ccl_settings_destroy(settings);
    free(settings);
    

    IMPORTANT:No need to set gatewayUrl and LogLevel settings for your production release. The Conviva sensor provides the default values for production.

    Expected Errors Due to Dual Stack IPv4/v6 Network Support

    When the Conviva sensor is initialized with production settings, the SDK sends a single request to the endpoints below:

    • [customer_key].ipv4.cws.conviva.com for IPv4 only

    • [customer_key].ipv6.cws.conviva.com for IPv6 only

    Sending both requests enables correlation of IPv4 and IPv6 addresses in dual-stack networks. If only IPv4 or IPv6 addressing is used (single-stack networking), it is expected that one request will fail. All the following requests will be sent to the endpoint below which supports both IPv4 and IPv6:

    • [customer_key].cws.conviva.com

  • Implement Platform Interface

    The ccl_platform_t object allows the client to implement the platform dependent functions for the Conviva library, such as thread, time/timer, file, and network. For example, the epoch_time_ms() method that returns the current epoch time in millseconds can be implemented as shown in this example:

    uint64_t epoch_time_ms(void)
    {
        struct timeval tv;
        gettimeofday(&tv, NULL);
        return (uint64_t) (tv.tv_sec * 1000LL + tv.tv_usec / 1000);
    }
    

    Similarly, the methods mem_alloc() and mem_free() which allow the application to manage memory can be implemented as shown in this example:

    void* mem_alloc (size_t mem_size)
    {
          if(mem_size > 0)
        return malloc(mem_size);
     
          return NULL;
    }
    void mem_free (void *memory)
    {
          if(NULL != memory)
        free(memory);
    }
    
    If mem_alloc() and mem_free() implementation is not required, then set it to "NULL".

    The epoch_time_ms(), mem_alloc(), and mem_free() methods can then be assigned to the respective members of the ccl_platform_t object.

    A complete example that runs on Linux is included in the SDK.

    Implement Device Metadata

    While initializing C SDK through ccl_init(), C SDK will callback get_platform_metadata() API which is part of ccl_platform_t structure. Application shall provide all the platform metadata in ccl_platform_metadata_t structure when get_platform_metadata() API is called. The following is a code example that demonstrates the get_platform_metadata() callback implementation:

    /* Sample implementation of get_platform_metadata in application */
    void get_platform_metadata (ccl_platform_metadata_t *metadata)
    {
        metadata->device_type = CCL_DEVICE_TYPE_DESKTOP;
        metadata->device_category = CCL_DEVICE_CATEGORY_LNX;
        strncpy(metadata->device_brand, "Dell", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->device_manufacturer, "Dell", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->device_model, "x86_64", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->device_version, "1.0", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->framework_name, "gstreamer", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->framework_version, "1.0", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->operating_system_name, "Linux", CCL_MAX_PLATFORM_METADATA_LENGTH);
        strncpy(metadata->operating_system_version, "#31-Ubuntu SMP 2018", CCL_MAX_PLATFORM_METADATA_LENGTH);
        metadata->screen_height = 1080;
        metadata->screen_width  = 1920;
        metadata->screen_scale_factor = 1.0;
    }
    

    2. Configure Metadata

    Metadata enables analysis of your data using different dimensions, for example, content, audience, device, workflow, player, and operating system.

    Conviva categorizes metadata tags into three buckets (Predefined, Device, Custom).

    Implement Video Metadata

    Implement pre-defined and custom tags for video by setting the properties of the ccl_content_info_t object.

    Please refer to the below example illustrating pre-defined and custom metadata implementation for video:

    // Create a ccl_content_info_t object and supply relevant metadata for the requested ads.
    ccl_content_info_t *video_content_info = ccl_content_info_create();
    // set the values for the fields defined in the ccl_content_info_t structure
    video_content_info->asset_name = strdup("[channel_id] Live Channel Name");
     
    // Create the dictionary for the custom tags:
    video_content_info->tags = ccl_dictionary_create();
     
    // Set the Conviva defined tag key/values to the dictionary:
    ccl_dictionary_put(video_content_info->tags, "c3.cm.contentType", "Live-Linear");
     
    // Set any custom tags as required:
    ccl_dictionary_put(video_content_info->tags, "my_custom_tag_key", "my_custom_tag_value");
     
    // Once the session is cleaned up, destroy the dictionary:
    ccl_dictionary_destroy(video_content_info->tags);
    

    Implement Ad Metadata

    Implement pre-defined and custom tags for ad content by setting the properties of the ccl_content_info_t object.

    Please refer to the below example illustrating pre-defined and custom metadata for ads:

    / Create a ccl_content_info_t object and supply relevant metadata for the requested ads.
    ccl_content_info_t *ad_content_info = ccl_content_info_create();
    // set the values for the fields defined in the ccl_content_info_t structure
    ad_content_info->asset_name = strdup("My preroll ad title");
     
    // Create the dictionary for the custom tags:
    ad_content_info->tags = ccl_dictionary_create();
     
    // Set the Conviva defined tag key/values to the dictionary:
    ccl_dictionary_put(ad_content_info->tags, "c3.ad.id", "44556667445");
     
    // Set any custom tags as required:
    ccl_dictionary_put(ad_content_info->tags, "my_custom_tag_key", "my_custom_tag_value");
     
    // Once the session is cleaned up, destroy the dictionary:
    ccl_dictionary_destroy(ad_content_info->tags);
    

    Pre-defined Metadata for Video and Ads

    Conviva defines the constants or fixed string keys for commonly used metadata. These metadata keys provide critical information about video and ad content, versioning, workflow.

    The below tags shall be added to both video and ad ccl_content_info_t objects:

    Constants for Pre-defined Metadata for Video and Ads

    Key / Constant Type Video (ccl_session_create) Ads (ccl_ad_session_create)
    ccl_content_info_t.asset_name char* Report as unique name for each stream/video asset. Values are up to your choice, but a human-readable text prefixed with the unique video ID works best in most Conviva sensors.This provides for clarity in reports and makes most popular content easily identifiable.Pattern: [videoID] Video Title

    The following are typical patterns for VOD (movies and episodic content) and Live streams: Movie Pattern: [{contentId}] {Movie Title} Sample Value: [12345] The ABC Movie Episode Pattern: [{contentId}] {Show Title} - S:{Season Number}:E{Episode Number} - {Episode Title} Sample Value: [67890] The XYZ Show - S3:E1 - The Pilot Episode Live Stream Pattern: [{channelNumber}] {Chanel Name} Sample Value: [10] PQRS Bay Area

    Report as "ad title" or "[ad_id] ad_title".
    ccl_content_info_t.is_live int [0/1] Denotes whether the content is video on-demand or a live stream. Affects the computation and availability of the Conviva metrics. For Ads, the value shall be the same as for the video stream.
    ccl_content_info_t.player_name char* A string value used to distinguish video players (applications). Simple values that are unique across all of your integrated platforms work best here. If the same player used across multiple platforms, e.g Tizen, LG TV, WEB, give separate names for each application / platofrm: e.g "JS Tizen", "JS LGTV", "JS WEB". Do not include the build or version number in this property. The intention is to have a simple way of differentiating data from different players / platforms. Automatically copied from the video session.
    ccl_content_info_t.viewer_id char* Required for Viewers Module. A unique identifier to distinguish individual viewers or devices through Conviva's Viewers Module. The value shall be unique abstract user's identifier. If user is anonymous, do not set any value for this tag. Automatically copied from the video session.
    ccl_content_info_t.stream_url char*

    The manifest URL of the video stream. The Conviva backend config server attempts to map a portion of StreamURL into a CDN name. For example: In the URL https://www.akamai.net/avengers.m3u8, akamai.net maps to the AKAMAI label. Conviva VSI users can then retrieve metrics based on the mapped CDN name (AKAMAI, in this case).

    The URL values reported in the streamURL are case insensitive. The streamURLs with either uppercase or lowercase are acceptable.
    The manifest URL of the ad stream.
    ccl_content_info_t.default_resource char*

    Video server resource the stream is played from. Set this field when the video server resource cannot be inferred from the STREAM_URL.

    For example, if the streamURL is https://cbd12348.cdn.cms.somewebsitehostname.com/abc.txt, it is not possible to infer the AKAMAI name from the streamURL, and in such a case, it is necessary to report the default_resource as AKAMAI.

    The DEFAULT_Resource value is case sensitive. If the resource name is initially reported as AKAMAI (uppercase) and subsequently modified in the app to akamai (lowercase), it is necessary to inform Conviva about the change because both need to be mapped in the Conviva backend configuration server to ensure that both point to the same CDN name (AKAMAI).
    Ad server resource the stream is played from. Set this field when the video server resource cannot be inferred from the STREAM_URL.
    ccl_content_info_t.duration int Duration of the video content, in seconds. Duration of the single ad clip, in seconds. For example, in a block of 3 ads each 30 seconds long, report 30 sec for each corresponding ad.
    "c3.app.version" char* Application build version. Shall have the same value for both ads and video. Set it by calling: ccl_dictionary_put (video_content_info->tags, "c3.app.version", "1.0.123"); Application build version. Shall have the same value as for the video content. Set it by calling: ccl_dictionary_put (ad_content_info->tags, "c3.app.version", "1.0.123");

    IMPORTANT: To assign content category labels, such as Audio, Trailer, Tile Play, or Short Video, use the c3.cm.categoryType pre-defined content metadata constant.

    Constants for Pre-defined Metadata for Video Only

    These metadata tags shall be set via ccl_content_info_t* video_content_info->tags object for video session:

    Key Type Description
    "c3.cm.contentType" string Advanced content delivery methods along with Live and VOD.

    Acceptable values: "Live", "Live-Linear", "DVR", "Catchup", "VOD".

    "c3.cm.channel" string The channel on which the content is consumed.

    Example: "ABC".

    "c3.cm.brand" string The name of the brand to which the content belongs.

    Examples: "ABC X", "ABC Y".

    "c3.cm.affiliate" string Affiliate or MVPD name for TV Everywhere authenticated services.

    Examples: "Xfinity", "Comcast".

    "c3.cm.categoryType" string

    Content business categories of interest.

    Use this constant to assign content category labels, such as Audio, Trailer, Tile Play, or Short Video.

    Examples: "Episodic", "Movies", "News", "Sports", "Events", "Informercials", "Shorts", "Promos", "Audio", "Tile Play", "Short Videos", "Trailer".

    "c3.cm.name" string Name of CMS Provider.

    Examples: "CMS", "ROVI", "TMS".

    "c3.cm.id" string Unique asset identifier to query CMS system to gather additional asset metadata information for a specific asset.

    Example: "003b094d-fc5c-3d5a-8ed0-301bf848291e".

    "c3.cm.seriesName" string The name of Series. Set the value only if the metadata cannot be gathered from CMS System. Null if not applicable.

    Examples: "Friends", "Null".

    "c3.cm.seasonNumber" string The Season number. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.

    Examples: "1", "Null".

    "c3.cm.showTitle" string The name of the Episode or Show Title. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.

    Examples: "The One with All the Cheesecakes", "Null".

    "c3.cm.episodeNumber" string The Episode number. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.

    Examples: "3", "Null".

    "c3.cm.genre" string The Primary content genre. Set the value only if the details cannot be inferred from Asset Provider Server. Null if not applicable.

    Examples: "Drama", "Null".

    "c3.cm.genreList" string The list of the applicable content genre. Set the values in a comma separated list only if the details cannot be inferred from Asset Provider Server. Null if not applicable.

    Examples: "Drama, Crime, Political, Violence", "Null"

    "c3.cm.utmTrackingUrl" string Provide the UTM parameters in the URL to track the effectiveness of the online marketing campaign across traffic sources and publishing media. Conviva uses CONTAINS logic to parse the individual UTM parameters from the URL provided, so either the full URL or just the UTM parameters is acceptable.

    Example values: http://www.example.com/?utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale&utm_content=toplink or utm_source=newsletter1&utm_medium=email&utm_campaign=summer-sale&utm_content=toplink

    This tag is only applicable for web and mobile devices.

    Constants for Pre-defined Metadata for Ads Only

    Implement the pre-defined metadata specified in the table below.

    These metadata tags shall be set via ccl_content_info_t* ad_content_info->tags object for ad session:

    Key Type Description
    "c3.ad.technology" string Set the technology to which the ad belongs. Allowed values are "Server Side" and "Client Side".
    "c3.ad.id" string The Ad ID extracted from the Ad Server that actually has the ad creative. For wrapper ads, this is the last Ad ID at the end of the wrapper chain. Example: "411687224".
    "c3.ad.system" string The name of the Ad System (i.e. the Ad Server). This Ad System represents the Ad Server that actually has the ad creative. For wrapper ads, this is the last Ad System at the end of the wrapper chain. Set to "NA" if not available. Examples: "Freewheel", "Innovid", "Extreme IO", "NA".
    "c3.ad.position" string

    The position of the ad.

    Allowed values are "Pre-roll", "Mid-roll", and "Post-roll".

    "c3.ad.isSlate" string A boolean value that indicates whether this ad is a Slate or not. Set to "true" for Slate and "false" for a regular ad. By default, set to "false".
    "c3.ad.mediaFileApiFramework" string The name of the creative media framework. Generally used for VPAID ads. Set to "NA" for non-VPAID ads. Examples: "VPAID", "NA".
    "c3.ad.adStitcher" string "The name of the Ad Stitcher. If not using an Ad Stitcher, set to "NA". Examples: "Uplynk", "Google DAI", "Google Anvato", "YoSpace", "NA".
    "c3.ad.firstAdSystem" string Only valid for wrapper VAST responses. This tag must capture the "first" Ad System in the wrapper chain when a Linear creative is available or there is an error at the end of the wrapper chain. Set to "NA" if not available. If there is no wrapper VAST response then the Ad System and First Ad System should be the same. Examples: "GDFP", "NA".
    "c3.ad.firstAdId" string Only valid for wrapper VAST responses. This tag must capture the "first" Ad Id in the wrapper chain when a Linear creative is available or there is an error at the end of the wrapper chain. Set to "NA" if not available. If there is no wrapper VAST response then the Ad Id and First Ad Id should be the same. Examples: "709684096", "NA".
    "c3.ad.firstCreativeId" string Only valid for wrapper VAST responses. This tag must capture the "first" Creative Id in the wrapper chain when a Linear creative is available or there is an error at the end of the wrapper chain. Set to "NA" if not available. If there is no wrapper VAST response then the Ad Creative Id and First Ad Creative Id should be the same. Examples: "57861167296", "NA".
    "c3.ad.creativeId" string The creative id of the ad. This creative id is from the Ad Server that actually has the ad creative. For wrapper ads, this is the last creative id at the end of the wrapper chain. Set to "NA" if not available. Examples: "57861167296", "NA".

    Device Metadata

    The above section here prescribes how to implement platform metadata as a part of Platform Interface implementation. Device metadata is also used for inferring the device tags dimensions.

    Custom Metadata

    Refer to App Manager->Setup Metadata page for your account to find the custom tags which shall be implemented.

    Set custom tags in a similar way for either video or ads, by using appropriate adAnalytics / videoAnalytics object and its corresponding method.

    The API syntax can be found above in the corresponding sections for video and ads.

    Conviva recommends to label the custom tags as "MyCustomTag1" or "my_custom_tag", and not use the c3.cm format, for instance, c3.cm.MyCustomTag1. Conviva reserved the c3.cm naming convention for the pre-defined or required metadata.

    Update/Amend Metadata

    To update or amend metadata for video or ads, use the method:

    void ccl_session_update_content_info(ccl_session_t *session, const ccl_content_info_t *content_info)

    • session shall specify the corresponding ccl_session_t reference of ad or video session;

    • content_info is the object containing the updated or amended metadata, for ads or video correspondingly.

    The device metadata can be immediately set when the values are available.

    IMPORTANT: Please note that different Conviva products, such as Conviva VSI and Conviva Viewer Insights may have different logic with respect to handling updated values. Conviva recommends to update the metadata only when it is available and do not set any default values before the metadata is available.

    Ad Events and Metadata

    Report Ad Break

    This step is required to accurately report Video Startup Time. The time taken by the ad break shall not be counted towards VST. Notify Conviva sensor of the ad break events using the following APIs described below.

    Report ad break start
    int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes)
    
    • session: The identifier of the video monitoring session

    • name: Event name - "Conviva.PodStart"

    • attributes: Dictionary to set the ad related attributes

    Report ad start

    int ccl_session_ad_start(ccl_session_t* session)
    
    • session: The identifier of the video monitoring session
    ccl_session_ad_start(video_session);
    

    The ideal event for invoking this method is on main video pause, to clear stage for ad playback.

    Report ad end

    int ccl_session_ad_end(ccl_session_t* session)
    

    session: The identifier of the video monitoring session

    ccl_session_ad_end(video_session);
    
    Report ad break end
    int ccl_session_send_event(ccl_session_t *session, const char *name, ccl_dictionary_t *attributes)
    
    • session: The identifier of the video monitoring session

    • name: Event name - "Conviva.PodEnd"

    • attributes: Dictionary to set the ad related attributes

    The following steps are required when the video content contains pre-roll and mid-roll ads.

    Handling Pre-Rolls

    A common way to handle pre-roll ads is to preload the main content, pause it while the pre-roll ad plays, and then resume the main content after the pre-roll completes. Essentially, the ad plays while the main content is loaded. However, you don't want the play time for the ad to be counted as part of the Video Startup Time metric, nor do you want to be constantly polling the player while the ad runs. The solution is to notify the Conviva layer of the pre-roll's existence and its start and end events. To notify the PodStart and PodEnd, call the ccl_session_send_event() API . The ccl_session_player_attach() call is deferred, and the ccl_session_ad_start() API is called with required parameter. When the Pre-roll ad ends, call the ccl_session_ad_end API and attach ccl_player_t, as shown in the following code example:

    // Report ad break start
    ccl_dictionary_t *attr = ccl_dictionary_create();
    ccl_dictionary_put(attr, "adType", "Server Side");
    ccl_session_send_event(video_session, "Conviva.PodStart", attr);
    
    // Report ad start upon video pause or request for the ads
    ccl_session_ad_start(video_session);
    // ... Ad play
    // Report ad end once ad is played 
    ccl_session_ad_end(video_session);
    
    // Report ad break end
    ccl_dictionary_put(attr, "adType", "Server Side");
    ccl_session_send_event(video_session, "Conviva.PodEnd", attr);
    // release the attribute
    ccl_dictionary_destroy(attr);
    
    // Attach content player to the video sesson to start monitoring
    ccl_session_player_attach(video_session, ccl_player, player_data);
    

    Handling Mid-Rolls

    Ads played during the viewing of content are another case that needs to be handled correctly to maintain the accuracy of viewing metrics. For example, time spent viewing an ad should not be included in buffering ratio calculations. Likewise, your metrics would also be adversely affected by ending a session when an ad starts and starting a new session when it resumes.

    The solution is detach the session when the main content stops and a mid-roll ad starts. To resume the session, you attach either the same player instance or a new player instance when the ad stops. Call ccl_session_ad_start() followed by session ccl_session_player_detach() when the main content stops and a Mid-roll ad starts. To resume session monitoring, attach the same ccl_player_t instance when the ad stops. To notify the PodStart and PodEnd, call the ccl_session_send_event() API.

    The following API calls are needed to detach and re-attach the session to skip a mid-roll ad. These APIs are documented in the API Reference:

    // As soon as the content is paused, call:
    ccl_session_player_detach(ccl_session_t * video_session);
    
    // Report ad break start
    ccl_dictionary_t *attr = ccl_dictionary_create();
    ccl_dictionary_put(attr, "adType", "Server Side");
    ccl_session_send_event(video_session, "Conviva.PodStart", attr);
    
    // Report ad start
    ccl_session_ad_start(video_session);
    // ... Ad play
    // Report ad end once ad is played 
    ccl_session_ad_end(video_session);
    
    // Report ad break end
    ccl_dictionary_put(attr, "adType", "Server Side");
    ccl_session_send_event(video_session, "Conviva.PodEnd", attr);
    // release the attribute
    ccl_dictionary_destroy(attr);
    
    // Attach content player to the video sesson to start monitoring
    ccl_session_player_attach(video_session, ccl_player, player_data);
    

    Implement Ad Metadata

    Implement pre-defined common metadata and pre-defined ad metadata following the corresponding specifications.

    Report Ad Metrics

    The ad metrics and ad video events shall be implemented in a similar way to the main video content - using ccl_player_t callbacks or ccl_notifier_t interface. Refer to the above sections Init Interfaces and Report Metrics and events.

    3. Report Events and Metadata

    Manage Video Session

    To create video session

    Use the following method to create Conviva monitoring session upon user playback request, along with metadata (content, workflow, audience, and other relevant metadata):

    ccl_session_t* ccl_session_create(ccl_content_info_t * video_content_info)
    
    • video_content_info: pointer to the instance of cl_content_info_t, containing metadata.

    • Returns: on success, pointer of ccl_session_t instance, on failure returns NULL.

    The keys / constants and expected values of the required metadata tags are defined in the Configure Metadata section.

    The sample code below illustrates video session creation:

    /* Create a ccl_content_info_t object with video metadata */
      ccl_content_info_t *video_content_info = ccl_content_info_create();
      /* set the values for the fields defined in the ccl_content_info_t structure */
      /* Note that your application is responsible for memory allocation / release for the ccl_content_info_t fields */
      video_content_info->asset_name = strdup("[channel_id] Live Channel Name");
      // ... add the rest of metadata as prescribed by the below specification
     
      /* create a video session object with the content info */
      ccl_session_t *video_session = ccl_session_create(video_content_info);
     
      /* ccl_content_info object can be immediately destroyed, if no future metadata update required */
      free(video_content_info->asset_name);
      // .. release the memory for the rest of the fields
      ccl_content_info_destroy(video_content_info);
      video_content_info = 0;
    

    IMPORTANT: It's critical to make this API call correctly to monitor video experience - monitoring session created from this moment, and key metrics are captured based on this event. For example, if this call done late (say, when video starts rather than user clicks 'play'), the Video Startup Time will be under-reported, Video Start Failures will be missed, etc.

    Please note that each video should be monitored separately - call this method for each new video played.

    IMPORTANT: If some of the content metadata tags aren't available at start, they can be set later or amended by ccl_session_update_content_info() API - refer here for details. Please note, in most cases that it's required to set content metadata before the player reports "play" for the first time, to accurately attribute metadata to the video asset.

    Refer to the below table which prescribes when to invoke the corresponding API calls:

    Invoke ccl_session_create() On: Invoke ccl_session_destroy() On:
    User clicks play button User stops the video; User starts another video; Video ends;
    Video starts in autoplay mode
    A new video starts in playlist
    Video item ends in playlist

    To close video session

    Report end of playback by using the method:

    ccl_session_destroy(video_session);
    
    After integrating the video player, review advanced use cases such as live program and playlist changes, fatal errors, and foreground and background actions that can be applicable for specific goals.

    Manage Ad Session

    To create ad session

    Use the following method to monitor Ad video:

    ccl_session_t* ccl_ad_session_create(ccl_session_t* video_session, ccl_content_info_t* ad_content_info)
    
    • video_session: pointer to the instance of video session.
  • ad_content_info: pointer to the instance of cl_content_info_t, containing metadata. - Returns: on success, pointer of ccl_session_t instance, on failure returns NULL.

    The keys / constants and expected values of the required metadata tags are defined in the Configure Metadata section.

    IMPORTANT: This method shall be used for each ad pod in the ad break. E.g., if there are 3 ads in the ad break, create / close ad session 3 times.

    IMPORTANT: It's critical to make this API call correctly to monitor ad experience - monitoring session created from this moment, and key metrics are captured based on this event. For example, if this call done late (say, when ad starts rather than ad is requested), the Ad Startup Time will be under-reported, Ad Start Failures will be missed, etc.

    The sample code below illustrates ad session creation:

    /* Create a ccl_content_info_t object for ad metadata */
      ccl_content_info_t *ad_content_info = ccl_content_info_create();
      /* set the values for the fields defined in the ccl_content_info_t structure */
      /* Note that your application is responsible for memory allocation / release for the ccl_content_info_t fields */
      ad_content_info->asset_name = strdup("[ad_id] My Ad Title");
      // ... add the rest of metadata as prescribed by the below specification
      /* create ad session object with the reference to the video_session passed and ad info */
      ccl_session_t *ad_session = ccl_session_create(video_session, ad_content_info);
     
      /* ccl_content_info object can be immediately destroyed, if no future metadata update required */
      free(ad_content_info->asset_name);
      // .. release the memory for the rest of the fields
      ccl_content_info_destroy(ad_content_info);
      ad_content_info = 0;
    
  • To close ad session

    Report end or skip of an ad by using the method:

    ccl_session_destroy(ad_session);
    

    Initialize Metric Reporting Interfaces

    Initialize ccl_player_t

    The Conviva sensor uses ccl_player_t instance to collect video playback data from your media player.

    As soon as ccl_player_t instance is attached to a session and the Conviva sensor starts monitoring it, the start_monitoring() callback is called by Conviva sensor. The callback provides pointer to the ccl_notifier_t object to the application.

    The following sample code illustrates how to instantiate ccl_player_t object:

    /* Create an instance of ccl_player_t. This instance shall be available
    throughout the player session */
    ccl_player_t player = {
        start_monitoring,
        stop_monitoring,
        get_playhead_time,
        get_buffer_length,
        get_rendered_framerate,
        get_min_buffer_length,
        get_player_type,
        get_player_version
    };
    

    The "get_*" callbacks above shall be implemented to report video or ad player metrics. Conviva sensor will be polling these methods periodically to receive current values. The detailed specification is provided here.

    Attach ccl_player_t to the session

    Once the ccl_player_t instance is created, attach it to the current session to report the events and metrics into that session. int ccl_session_player_attach(ccl_session_t* session, const ccl_player_t* player, void* player_data)

    • session: pointer to a ccl_session_t. It can be either video or ad session, depending on the session type to which player is being attached.

    • player: pointer to the instance which will be used for reporting the metrics and events.

    • player_data: pointer to the context object of your player / player wrapper, providing actual player metric data. This object will be passed across the callbacks.

    Implement start_monitoring() callback

    The start_monitoring() callback is called by the Conviva sensor as soon as the player is attached to the session. Through the ccl_notifier_t instance, you can update playback states, buffering state, bitrate, duration and so on.

    Retain the pointer to the ccl_notifier_t and ccl_notifier_context_t objects until stop_monitoring() is called.

    void start_monitoring(void *player_data, ccl_notifier_t *notifier, ccl_notifier_context_t *notifier_context)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      player->notifier = notifier;
      player->notifier_context = notifier_context;
    }
    

    The stop_monitoring() callback of ccl_player_t is called when the ccl_player_t instance is detached from the session. Do not anymore use the ccl_notifier_t object returned by the start_monitoring() since this moment. Refer to the below sample code:

    void stop_monitoring(void *player_data)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      player->notifier = 0;
      player->notifier_context = 0;
    }
    

    Report Metrics and Events

    Conviva C SDK is universal and player agnostic, therefore it can be used to integrate any video player / any platform in C language.

    The video and ad events and metrics are repoted by two methods, following "push" and "pull" approach respectively.

    • "Push": directly set values of new metrics / report events from the application to the SDK. There are two ways to report the metrics: directly using the top-level ccl_* methods, or via ccl_notifier_t interface.
      To report metrics via ccl_player_t interface, the instance of this object shall be attached to the current video or ad session, respectively.

    • "Pull": implement callbacks of the ccl_player_t structure, and return the metric values from the corresponding callback values.

    The difference between the "push" and "pull" approaches is due to the metric nature. The event-driven metrics are reported directly via "push", while the metrics which instantly change during playback lifecycle (for example, buffer length) are collected via "pull" callbacks at a given frequency.

    To report playback failures

    int ccl_session_report_error (ccl_session_t *session, const char *error_message, int is_fatal)
    
    • session: reference to the corresponding session instance;

    • errorMessage: string message specifying the error. Report the reason of the failure, avoid including metadata.

    • is_fatal: set to 1 if the error is fatal, set to 0 for warning.

    Example usage:

    // report error to the session.
    ccl_session_report_error(session, errorMsg, 1);
    // cleanup session if no further re-try expected, otherwise keep session
    // open until the last re-try
    ccl_session_destroy(session);
    

    To report playback events

    To report metric events refer to the below table, which prescribes the required events and the corresponding API / method to report the metric.

    The below methods are called via the instance of ccl_notifier_t object player->notifier, provided as argument in the callback start_monitoring(), or directly via 'ccl_*' APIs.

    Event Method Implementation Note
    Player state change notifier->set_state(ccl_notifier_context_t *notifier_context, ccl_player_state_t new_state) Report any player state changes such as Playing, Buffering, Paused. The new_state parameter is enum of ccl_player_state_t type.
    Peak Bitrate / cdn / resource change notifier->set_stream(ccl_notifier_context_t *notifier_context, int newbitrate /*kbps*/, const char* newcdn, const char* newresource);

    Report new peak bitrate value (in kbps) on change event (video + audio, or video only if audio isn't available). Along with the peak bitrate value, pass the new video resource or CDN, if applicable. To skip setting new resource or CDN, pass null as a corresponding value.

    For the Average Peak Bitrate definition, refer to Average Peak Bitrate in the Metric Dictionary.

    Seek start / end notifier->set_seek(player->notifier_context,ccl_seek_action_t action, int seektoposition) Report start of seeking or scrubbing by user. The argument action defines whether it's seek start or seek end (CCL_PLAYER_SEEK_START / CCL_PLAYER_SEEK_END). If seek position is known, report as the method argument seektoposition. If seek position is unknown, pass -1.
    Set CDN IP notifier->set_CDNServerIP(ccl_notifier_context_t *notifier_context, const char *CDNServerIP) Report change of the CDN Server IP. The CDNServerIP New CDN Edge Server IP used to serve video stream.
    Please contact Conviva Support to enable auto collection configuration.
    Average Bitrate Change notifier->set_average_bitrate(ccl_notifier_context_t *notifier_context, int newbitrate /*kbps*/);

    Report new average bitrate value (in kbps) on bitrate switch event (video + audio, or video only if audio isn't available).

    For the Avg. Average Bitrate definition, refer to Avg. Average Bitrate in the Metric Dictionary.

    Dropped Frames Total notifier->set_dropped_frame_total(ccl_notifier_context_t *notifier_context, int droped_frame_total) Report the cumulative dropped frames count.
    Set video resolution ccl_session_set_video_size(ccl_session_t *session, int width, int height) Report video resolution change. The argument session identifies the session which the change is reported to. The width and height provide the current video rendition resolution.
    Set Audio/ Subtitles/ Closed Captions Language notifier->report_langauge_event (ccl_notifier_context_t *notifier_context, ccl_langauge_event_type_t language_event, const char* language_name)

    Report language change event. The argument language_event denotes the type of reporting language and holds one of the following values:CCL_EVENT_AUDIO_LANGUAGE CCL_EVENT_SUBTITLES_LANGUAGE CCL_EVENT_CLOSED_CAPTIONS_LANGUAGE

    language_name is the name of the language in the [langCode]:langName format, for example, [en]:English. When only one of them is available, report it as such, for example, en or English.

    IMPORTANT: At any given time, a player can report the language of either the subtitles or the closed captions. When it reports one of them, the other language is set to off if it has already been reported. Report these languages (if they're available) on session start as well as when the user changes them on the current playback.

    Example:

    // report closed_captions_language as "[en]:English” ([langCode]:langName)
    ccl->notifier->report_langauge_event(session, CCL_EVENT_CLOSED_CAPTIONS_LANGUAGE, "[en]:English");
    // report the subtitles_language = "fr" (consider only language code is available)
    // reporting the subtitles will set the previously-reported closed_captions_language = "off"
    ccl->notifier->report_langauge_event(session, CCL_EVENT_SUBTITLES_LANGUAGE, "fr");
    

    If the audio, subtitle, or closed captions language option was initially enabled but later disabled, ensure to report the most recent language option value as off. Example:

    ccl->notifier->report_langauge_event(session, CCL_EVENT_SUBTITLES_LANGUAGE, "off");
    

    To implement callback metrics

    The following metrics are reported as a return value by corresponding callbacks of the ccl_player_t object. Refer to the details of the ccl_player_t initialization here.

    Metric Method Implementation Note
    Playhead time int(* ccl_player_t::get_playhead_time)(void *player_data) Retrieves the current position of the play head, in milliseconds. The current position within the video content measures how far along into the video we are, relative the start of the content.
    Buffer length int(* ccl_player_t::get_buffer_length) (void *player_data) Retrieves the number of milliseconds worth of data present in the video buffer. Return -1 if not available.
    Minimum Buffer length int(* ccl_player_t::get_min_buffer_length) (void *player_data) Retrieves the minimum buffer length threshold (in milliseconds) for the video to keep playing. Return -1 if not available.
    Rendered framerate double(* ccl_player_t::get_rendered_framerate) (void *player_data) Retrieves the current rendered frame rate, in frames per second. A moving average over the last couple seconds is recommended. Rendered frame rate of 0 indicates no video frames have been rendered during the last sampling window. Return -1.0 if not available.

    Refer to the below code sample for illustration of the callback metric implementation:

    /* Return current media position in milliseconds. -1 if not available */
    int get_playhead_time(void *player_data)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      return player->position;
    }
     
    /* Return current buffer length in milliseconds. -1 if not available */
    int get_buffer_length(void *player_data)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      return player->bufferLength;
    }
     
    /* Return Current rendered frame rate, in frames per second. -1.0 if not available */
    double get_rendered_framerate(void *player_data)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      return player->rFramerate;
    }
     
    /* Return minimum buffer length required for player to continue playing in milliseconds.
     -1 if not available or player state inference by CCL is disabled */
    int get_min_buffer_length (void *player_data)
    {
      MyMediaPlayer *player = (MyMediaPlayer *) player_data;
      return player->min_buffer_length;
    }
    

    4. Handle User Actions

    User Actions: Backgrounding

    On backgrounding: set the player state to "paused".

    On foregrounding: continue reporting player state changes / metrics in a regular way.

    Report Network Metrics

    Connection Type

    It requires the application to detect the connection type and send through void ccl_notify_network_connection_type( const char * type ) API:

    // The network connection type that the video player is using.
    ccl_notify_network_connection_type ("WiFi");
    

    The table below shows the representation string values for the setConnectionType() API:

    Internet Connection Type Representation String
    Wireless WiFi
    Wired Ethernet
    Cellular 2G 2G
    Cellular 3G 3G
    Cellular 4G 4G
    Cellular 5G 5G
    Other OTHER

    If you can fetch wireless connection sub-type, such as "802.11 a", "802.11b", "802.11n", "802.11g", then pass the sub-type instead of "WiFi". If you can measure 4G data connection sub-type like "LTE", then pass the sub-type instead of "4G".

    The Network Connection Type can be updated after session creation, but only before the first video frame is rendered.

    Signal Strength

    Set the current WiFi signal strength of your device using the following method:

    void ccl_notify_network_signal_strength(double signal_strength)

    The value of the signal strength is a double in decibel-milliwatts (dBm) that your device detects.

    Set the current WiFi link encryption of your device using the following method:

    void ccl_notify_network_wifi_link_encryption(const char *name) The values for the link encryption can be any string that your device detects, such as WPA2, WPA, EAP, WEP, NONE.

    Report Custom Events

    Player Insight is an advanced feature which allows you to track custom events that are not related to video rendering, but rather specific to your player's functionality. These events and their attributes are then tabulated in the Player Insight dashboard at Conviva VSI (Pulse). Contact your Conviva representative to enable Player Insights in Pulse.

    You may send a custom Player Insight event that can be associated with a video playback using the following method:

    Report video-related events by the method int ccl_session_send_event (ccl_session_t *session, const char *name, ccl_dictionary_t *attributes):

    /* create an attribute */
    ccl_dictionary_t *attr = ccl_dictionary_create();
    ccl_dictionary_put(attr, "old_quality", "SD");
    ccl_dictionary_put(attr, "new_quality", "HD");
    ccl_dictionary_put(attr, "player", "STB player");
     
    /* send the event */
    ccl_session_send_event(video_session, "video_quality_change", attr);
    /* release the attribute */
    ccl_dictionary_destroy(attr);
    

    Report app-level events by the method ccl_send_event (const char *name, ccl_dictionary_t *attributes):

    // Sample for "share-click" event with 3 arguments
     
    /* create an attribute */
    ccl_dictionary_t *attr = ccl_dictionary_create();
    ccl_dictionary_put(attr, "location", "Toolbar");
    ccl_dictionary_put(attr, "assetName", "Sample Video");
    ccl_dictionary_put(attr, "shareService", "Facebook");
     
    /* send the event */
    ccl_send_event("share_click", attr);
    /* release the attribute */
    ccl_dictionary_destroy(attr);
    

    5. Cleanup

    Releases the library and all tied up memory / resources

    ccl_cleanup (void);
    

    Advanced Use Cases

    You can use specific APIs in the Conviva sensor for various advanced use cases, such as:

    • Live or live linear streaming program changes

    • Video changes in the playlist

    • Playback does not recover from error and is reported once only

    • Multiple errors due to retry when playback does not recover

    • Playback recovers from a fatal error by switching to a different asset URL or CDN

    • A warning occurs when there's no impact on the playback

    • Handling user actions, such as user dialogues

    To learn more about these advanced use cases, see here.

    Self Validation

    Upon completion of your integration, and before submission to Conviva QA team, developers should complete a comprehensive self-validation test pass of each Device Application.

    Perform self-validation of video sensor integration using Touchstone in Pulse.

    Conviva provides sample test cases with detailed steps and expected results.

    Developers should be checking for both metric and metadata accuracy. Based on our experience, comprehensive self-validation can reduce your QE cycles, saving your costly project time.