Follow these instructions to complete the Conviva VSI Sensor integration on Windows/Xbox One C# players.
Step 1: Install Conviva Library
Developer Steps
Step 2: Configure Metadata
Developers Steps
Step 3: Report Events and Metadata
Developer Steps
Step 4: Handle User ActionsUse Conviva methods to report custom events. Developer Steps
Step 5: Clean Up Session
Developer Steps
|
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
Install the library and add dependencies.
Initialize the
WinClientobject using your CUSTOMER_KEY.Using an instance of
WinClientreport video related events.
Implement the metadata by following the instructions to use the pre-defined keys, as well as custom metadata if defined.
Conviva library autocollects device metadata.
Implement advanced metadata and events as prescribed by the corresponding specification.
Report ad break start / end.
Pause/Resume monitoring of video metrics by marking the start and end of ads in the video stream.
Implement the
WinClient.createSession(contentInfo, playerProxy)method to report playback attempt request along with metadata (content, workflow, audience, and other relevant metadata) and the player proxy.Use the
WinClient.createSession(contentInfo, playerProxy)for each ad in the ad break.Use the
WinClient.cleanupSession()method to report the of end playback or ad playback.
Conviva library autocollects Network Metrics.
Call the WinClient.cleanupSession() and playerProxy.cleanupStreamerProxy() API's to gracefully end the monitoring session associated with current video asset playback.
Test and Validate
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.
Use Touchstone in Pulse to perform self-validation and debugging of video sensor integration.
https://.ts-testonly.conviva.com
- Done! Analyse your data in Pulse and improve your viewer experience - let's make video experience better!
1. Install Conviva Library
Add Conviva Libraries and Configure Dependencies
|
Add core SDK |
To integrate a Windows/Xbox One MediaPlayer/MediaElement with Conviva, please include the Conviva library in your project. Download and add the library explicitly: Conviva Windows/Xbox One: MediaPlayer/MediaElement library. |
|---|
|
Initialize the top level object |
Conviva initialization is a one-time call that must occur at the earliest possibility in your application's initialization flow.
No need to set gatewayUrl and LogLevel settings for your production release explicitly. The Conviva sensor has the right default value. The allowed parameters are:
IMPORTANT: No need to set Expected Errors Due to Dual Stack IPv4/v6 Network SupportWhen the Conviva sensor is initialized with production settings, the SDK sends a single request to the endpoints below:
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:
|
|---|
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).
Pre-defined Video and Content 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 content, versioning, workflow.
Populate contentInfo object an instance of WinContentInfo() with the specified metadata.
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 Video and Content Metadata
| Key | Type | Implementation Note |
|---|---|---|
| assetName | string | contentInfo.setAssetName(string assetName)
For video content, use 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
|
| isLive | BOOL | contentInfo.setIsLive(BOOL isLive);
Denotes whether the content is video on-demand or a live stream. Affects the computation and availability of the Conviva metrics.
|
| playerName | string | contentInfo.setPlayerName(string playerName)
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 / platform: 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. |
| viewerId | string | contentInfo.setViewerId(string viewerId)
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. |
| streamUrl | string |
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 The URL values reported in the streamURL are case insensitive. The streamURLs with either uppercase or all lowercase are acceptable. |
| defaultCDN | string | contentInfo.setDefaultCDN(string defaultCDN)
This value specifies the video server or CDN name from where the streaming resource is played. Set this field when the video server resource cannot be inferred from the STREAM_URL. For example, if the streamURL is 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).
|
| duration | integer | Autocollected by the Conviva library.contentInfo.setDuration(int32 duration)
Duration of the video content, in seconds. |
| Player Framework Name | string | Autocollected by the Conviva library. |
| Player Framework Version | string | NOTE: Refer to the existing Limitations. |
| "c3.app.version" | string | Autocollected by the Conviva library.If you want to set it manually, report application build version from the application.contentInfo.setTag("c3.app.version", string value) |
| "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: This tag is only applicable for web and mobile devices. |
Constants for Pre-defined Metadata for Ads
| Key | Type | Implementation Note |
|---|---|---|
| streamUrl | string | contentInfo.setStreamURL(string streamURL)
The manifest URL of the ad stream. |
| assetName | string | contentInfo.setAssetName(string assetName)
Report as |
| isLive | BOOL | contentInfo.setIsLive(BOOL isLive);
For Ads, the value should be the same as for the video stream. |
| playerName | string | contentInfo.setPlayerName(string playerName)
Automatically copied from the video session. |
| viewerId | string | contentInfo.setViewerId(string viewerId)
Automatically copied from the video session.
|
| defaultCDN | string | contentInfo.setDefaultCDN(string defaultCDN)
Ad server resource the stream is played from. Set this field when the video server resource cannot be inferred from the STREAM_URL. |
| duration | integer | Autocollected by the Conviva library.contentInfo.setDuration(int32 duration)
Duration of the single ad session, in seconds. For example, in a block of 3 ads each 30 seconds long, report 30 sec for each corresponding ad. |
| Player Framework Name | string | Autocollected by the Conviva library. |
| Player Framework Version | string | NOTE: Refer to the existing Limitations. |
Implement the pre-defined metadata specified in the table below. These metadata tags shall be set via WinContentInfo setTag method for the ad session:
| Key | Type | Description |
|---|---|---|
| "c3.ad.technology" | string | Set the technology of the ad. Only allows the Constants.AdType.CLIENT_SIDE/SERVER_SIDE values. Allowed values: "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. Only allows Constants.AdPosition.PREROLL/MIDROLL/POSTROLL values which are string constants of "Pre-roll", "Mid-roll", and "Post-roll". |
| "c3.ad.isSlate" | string | A 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". |
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 video/ads, by adding the tags to the contentInfo object, passed into corresponding methods of WinClient object.
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 pre-defined and custom tags for video, use WinClient.updateContentInfo(sessionId, contentInfo):
sessionId: previously referenced sessionId during createSession call.contentInfo: map containing the key - value pairs of metadata tags for video content.
To update or amend pre-defined and custom tags for ads, use WinClient.updateContentInfo(adSessionId, contentInfo):
adSessionId: previously referenced sessionId during createAdSession call.contentInfo: map containing the key - value pairs of metadata tags for ad content.
Refer to the below example of setting pre-defined and custom metadata for video:
// Fetch metadata from CMS and pass non-null values to Conviva
// WinContentInfo Metadata Creation Block
WinContentInfo contentInfo = new WinContentInfo();
// required: unique value for every asset
if (assetName != null) {
contentInfo.setAssetName(assetName);
}
// highly recommended: dictionary of your custom metadata key/value string pairs
foreach (pair in customMetadata) {
string key = pair.key;
string value = pair.value;
if (key != null && value != null) {
contentInfo.setTag(key, value);
}
}
// required: e.g. "http://your.cdn.com/stream.m3u8"
if (streamURL != null) {
contentInfo.setStreamURL(streamURL);
}
// required: 1 for live content, 0 for VOD content
if (isLive == 1 || isLive == 0) {
contentInfo.setIsLive(isLive);
}
// required: e.g. "Windows UWP C# App"
if (playerName != null) {
contentInfo.setPlayerName(playerName);
}
// required for Viewers Module: e.g. "john@doe.com" or "12345"
if (viewerId != null) {
contentInfo.setViewerId(viewerId);
}
// optional: needed when the content's stream URL patterns
// are not sufficient to identify the CDN
if (defaultCDN != null) {
contentInfo.setDefaultCDN(defaultCDN);
}
//Update Content Info.
WinClient.updateContentInfo(sessionId, contentInfo);
Refer to the below example of setting pre-defined and custom metadata for ad:
// Fetch metadata from CMS and pass non-null values to Conviva
// WinContentInfo Metadata Creation Block
WinContentInfo winAdcontentInfo = new WinContentInfo();
// required: unique value for every asset
if (assetName != null) {
winAdcontentInfo.setAssetName(assetName);
}
// highly recommended: dictionary of your custom metadata key/value string pairs
foreach (pair in customMetadata) {
string key = pair.key;
string value = pair.value;
if (key != null && value != null) {
winAdcontentInfo.setTag(key, value);
}
}
// required: e.g. "http://your.cdn.com/stream.m3u8"
if (streamURL != null) {
winAdcontentInfo.setStreamURL(streamURL);
}
// required: 1 for live content, 0 for VOD content
if (isLive == 1 || isLive == 0) {
winAdcontentInfo.setIsLive(isLive);
}
// required: e.g. "Windows UWP C# App"
if (playerName != null) {
winAdcontentInfo.setPlayerName(playerName);
}
// required for Viewers Module: e.g. "john@doe.com" or "12345"
if (viewerId != null) {
winAdcontentInfo.setViewerId(viewerId);
}
// optional: needed when the content's stream URL patterns
// are not sufficient to identify the CDN
if (defaultCDN != null) {
winAdcontentInfo.setDefaultCDN(defaultCDN);
}
//Update Content Info.
WinClient.updateContentInfo(adsid, winAdcontentInfo);
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
An ad break is a single or a sequence of ads in the video stream. To collect the ad break metadata, notify Conviva of the start and end of an 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:
|
Report ad break start to the video session |
sessionId: The identifier of the video monitoring session. enAdType: CLIENT_SIDE (for Client Side Ad) or SERVER_SIDE (for Server Side Ad) |
|---|---|
| On Ad Break ended, call |
sessionId: The identifier of the video monitoring session. |
3. Report Events and Metadata
3. a. Integrate Video Player:
Report Playback Start |
The keys / methods and expected values of the required metadata tags are defined in the Implement Metadata section below. IMPORTANT: Player Proxy Media Player object shall be registered with Conviva proxy while creating player proxy object (MediaPlayerProxy / MediaElementProxy). Player proxy object shall be attached to Conviva session to monitor video experience.
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 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.
Adaptive Streaming If you are using the
|
||||||||
|---|---|---|---|---|---|---|---|---|---|
Attach or Detach Player |
When media player instance is available after session creation, media player instance can be attached with the Conviva session through The method signatures are:
|
||||||||
|
Report Playback Start with Deferred Streamer Attachment |
In certain scenarios, you create a video session but attach your player instance at a later stage, after checking for any errors that might occur after session creation but before streamer attachment. This is common when you use a DRM, when you create the player/streamer instance after a successful DRM validation. In such cases, you still create the monitoring session with its metadata as soon as the user has expressed intent to play the video (whether via auto-play or manually) but you attach your player/streamer instance via another method call, after manually reporting any errors that may have prevented successful playback. We count these errors with their corresponding messages - as Video Start Failures (VSFs). Your code will look similar to:
|
||||||||
|
Report Playback End |
Report end of playback by using these methods: If used, remove the AdaptiveMediaSource object from the player proxy:
Clean up each player proxy once the video stream it is registered to is no longer used. This avoids memory or resource leaks.
Finally, close the monitoring session:
|
Implement Advanced Metadata and Events
Set Peak Bitrate |
Peak Bitrate Reporting for HLS when Using AdaptiveMediaSourceMediaPlayer alone is not enough to gather information on video peak bitrate. If you use the Microsoft
If you change the AdaptiveMediaSource during playback, the following code is required to keep monitoring the right AdaptiveMediaSource:
Peak Bitrate Reporting for HLS when Not Using AdaptiveMediaSourceTo report peak bitrates for an HLS stream when you are not using the Peak Bitrate Reporting for MP4 and Smooth StreamingFor MP4 and Smooth Streaming, the Conviva library does not automatically detect the playing peak bitrate due to a limitation of the Windows UWP/Smooth Streaming Client SDK API. To report peak bitrate information from another source, use the
For Smooth Streaming, the playing bitrate is defined as the total playing bitrate, which includes both the audio and video tracks. For the Average Peak Bitrate definition, refer to Average Peak Bitrate in the Metric Dictionary. |
|---|---|
Set Average Bitrate |
Conviva library does not automatically detect the playing average bitrate due to a limitation of the Windows UWP. Conviva's UWP library depends on the application to report the average bitrate. Use the following API to report the video average bitrate:
For the Avg. Average Bitrate definition, refer to Avg. Average Bitrate in the Metric Dictionary. |
Report Seek Events |
Seek events allow us to calculate the Video Restart Time (VRT) metric, to differentiate between buffering caused by user seek and buffering caused by network conditions. Please visit the seek scenarios page to review VRT calculations. After a seek is triggered, and once the player has enough chunks downloaded to execute playback, Windows MediaPlayer raises a player seek end event. The player does not report any information on seek start, therefore the Conviva library cannot detect it. Due to this limitation, call Conviva's The following code sample reports the player seek start event to the Conviva library:
If the player's seek start event is not reported, the Video Restart Time metric will be under-reported and the Connection Induced Rebuffering Ratio metric will be over-reported. |
|
Report Custom Errors |
Fatal errors are any events preventing the user from seeing the video they attempted to play or any non-user event that causes midstream video playback failure (after the video starts successfully). These fatal errors should be reported and will be used to calculate Video Playback Failures (VPF) and Video Start Failures (VSF) metrics in Conviva VSI. Sample code for DRM Error reporting
|
|
Report CDN Server IP |
The Conviva UWP library depends on the application to report CDN server IP. When the CDN Server IP is available to the application, the same can be reported to Conviva. The CDN Server IP is of type String and is set as attribute of the WinClient class, which provides the following method:
The following code sample reports CDN Server IP to the Conviva UWP library:
|
|
Report Dropped Frames Count |
The dropped frames count for a specific interval is reported periodically. The Conviva UWP library depends on the application to report the dropped frames count. The dropped frames count is of the type Integer and is set as an attribute of the WinClient class, which provides the following method:
The following code sample reports the dropped frames count to the Conviva UWP library:
|
| Report Audio, Subtitles, or Closed Captions Language |
The Conviva UWP library depends on the application to report languages. Report the playback audio, closed captions, or subtitles language using:
The
The 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:
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:
|
3. b. Integrate Ad Managers:
Conviva core SDK is universal and player agnostic, therefore it can be used to integrate any Ad SDK using the programming language it's written for.
For ease and speed of integration, Conviva also provides plug-in modules for the most common Ad SDKs. The modules allow to auto-detect events from the particular player / Ad SDK.
If instructions for your Ad SDK are not shown below, please follow the instructions for "Custom Ad Manager" integration, or contact your Conviva representative.
Custom Ad Manager:
Report Ad Playback Start |
The keys / methods and expected values of the required metadata tags are defined in the Implement Metadata section below. IMPORTANT: Player Proxy Media Player object shall be registered with Conviva proxy while creating player proxy object (MediaPlayerProxy / MediaElementProxy). Player proxy object shall be attached to Conviva session to monitor video experience.
IMPORTANT: It's critical to make this API call correctly to monitor ad video experience - monitoring session created from this moment, and key metrics are captured based on this event. Please note that each ad video should be monitored separately - call this method for each new ad video played. IMPORTANT: If some of the content metadata tags aren't available at start, they can be set later or amended by 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.
|
||||
|---|---|---|---|---|---|
Attach or Detach Player |
For a Client side Ad, at the start of the ad, the media player instance can be attached with the Conviva Ad session through The method signatures are:
|
||||
|
Report Ad Playback End |
Report end of Ad playback by using these methods: If used, remove the AdaptiveMediaSource object from the player proxy:
Clean up each player proxy once the video stream it is registered to is no longer used. This avoids memory or resource leaks.
Finally, close the monitoring session:
|
Implement Advanced Ad Metadata and Events
Report Ad metrics to Ad Session by using the following:
Set Peak Bitrate |
Peak Bitrate Reporting for HLS when Using AdaptiveMediaSourceMediaPlayer alone is not enough to gather information on video peak bitrate. If you use the Microsoft
If you change the AdaptiveMediaSource during playback, the following code is required to keep monitoring the right AdaptiveMediaSource:
Peak Bitrate Reporting for HLS when Not Using AdaptiveMediaSourceTo report peak bitrates for an HLS stream when you are not using the AdaptiveMediaSource class, use the Peak Bitrate Reporting for MP4 and Smooth StreamingFor MP4 and Smooth Streaming, the Conviva library does not automatically detect the playing peak bitrate due to a limitation of the Windows UWP/Smooth Streaming Client SDK API. To report peak bitrate information from another source, use the
For Smooth Streaming, the playing bitrate is defined as the total playing bitrate, which includes both the audio and video tracks. For the Average Peak Bitrate definition, refer to Average Peak Bitrate in the Metric Dictionary. |
|---|---|
Set Average Bitrate |
Conviva Library does not automatically detect the average bitrate due to a limitation of the Windows UWP. Conviva's UWP library depends on the application to report the average bitrate. Use the following API to report the average bitrate:
For the Avg. Average Bitrate definition, refer to Avg. Average Bitrate in the Metric Dictionary. |
Report Seek Events |
Seek events allow us to calculate the Video Restart Time (VRT) metric, to differentiate between buffering caused by user seek and buffering caused by network conditions. Please visit the seek scenarios page to review VRT calculations. After a seek is triggered, and once the player has enough chunks downloaded to execute playback, Windows MediaPlayer raises a player seek end event. The player does not report any information on seek start, therefore the Conviva library cannot detect it. Due to this limitation, call Conviva's The following code sample reports the player seek start event to the Conviva library:
If the player's seek start event is not reported, the Video Restart Time metric will be under-reported and the Connection Induced Rebuffering Ratio metric will be over-reported. |
|
Report Custom Errors |
Fatal errors are any events preventing the user from seeing the video they attempted to play or any non-user event that causes midstream video playback failure (after the video starts successfully). These fatal errors should be reported and will be used to calculate Video Playback Failures (VPF) and Video Start Failures (VSF) metrics in Conviva VSI. Sample code for DRM Error reporting
|
|
Report CDN Server IP |
The Conviva UWP library depends on the application to report CDN server IP. When the CDN Server IP is available to the application, the same can be reported to Conviva. The CDN Server IP is of type String and is set as attribute of the WinClient class, which provides the following method:
The following code sample reports CDN Server IP to the Conviva UWP library:
|
|
Report Dropped Frames Count |
The dropped frames count for a specific interval is reported periodically. The Conviva UWP library depends on the application to report the dropped frames count. The dropped frames count is of the type Integer and is set as an attribute of the WinClient class, which provides the following method:
The following code sample reports the dropped frames count to the Conviva UWP library:
|
4. Handle User Actions
Report Network Metrics
The Conviva library automatically detects the network connection type (Ethernet, WiFi, 3G, OTHER). The Conviva library reports the raw values returned by the WWAN network connection data service class.
Use the following Conviva mapping to reference the raw values:
| Raw Value | Mapping |
|---|---|
| WiFi | WiFi |
| Cdma1xEvdo | 3G |
| Cdma1xEvdoRevA | 3G |
| Cdma1xEvdoRevB | 3G |
| Cdma1xEvdv | 3G |
| Cdma1xRtt | 3G |
| Cdma3xRtt | 3G |
| CdmaUmb | 3G |
| Edge | 2G |
| Gprs | 2G |
| Hsdpa | 3G |
| Hsupa | 3G |
| LetAdvanced | 4G |
| Umts | 2G |
| Custom | Other |
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 WinClient.sendEvent(SessionId sessionId, string eventName, Dictionary eventAttributes):
Following is an example of a custom event named TestEvent with two attributes:
WinClient.sendEvent(sessionId, "CustomEvent", {"attr1":"value1", "attr2":"value2"});
You may send a custom Player Insight event specific to your player's functionality, but not associated with a monitoring session by passing "0" (integer) for sessionId.
WinClient.sendEvent(0, "CustomEvent", {"attr1":"value1", "attr2":"value2"});
5. Clean Up Session
Each monitoring session needs to be cleaned up once the video stream it's attached to is no longer used. Depending on how the app/player is set up, this step may occur at the end of playback, during player deallocation, or before transitioning to a different stream.
Remove AdaptiveMediaSource (if applicable) |
If used, remove the
|
Clean up each player proxy once the video stream it is registered to is no longer used. This avoids memory or resource leaks. |
|
Close the content monitoring session |
|
Close the Ad monitoring session |
|
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 retrying 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.
Limitations
| Metric Name | Impact | Conditions | Issue |
|---|---|---|---|
| Peak Bitrate | Under-reported | HLS/DASH | Windows.Media.Streaming.Adaptive doesn't report audio bitrate. Conviva's bitrate calculations include both video and audio data, therefore the bitrate value is under-reported. |
| Under-reported | SS VOD | Smooth Streaming SDK doesn't report audio bitrate. Conviva's bitrate calculations include both video and audio data, therefore the bitrate value is under-reported. | |
| Not reported | SS LIVE | Smooth Streaming SDK doesn't report bitrate for LIVE streams. The stream bitrate can be manually updated by implementing ConvivaUWP.WinClient.setBitrate() API. |
|
| Average Bitrate | Under-reported | HLS/DASH | Windows.Media.Streaming.Adaptive doesn't report audio bitrate. Conviva's bitrate calculations include both video and audio data, therefore the bitrate value is under-reported. |
| Under-reported | SS VOD | Smooth Streaming SDK doesn't report audio bitrate. Conviva's bitrate calculations include both video and audio data, therefore the bitrate value is under-reported. | |
| Not reported | SS LIVE | Smooth Streaming SDK doesn't report bitrate for LIVE streams. The average bitrate can be manually updated by implementing ConvivaUWP.WinClient.setAverageBitrate() API. |
|
| Average Frame Rate | Not reported | All | Player doesn't support an API to fetch frame rate information. |
| Connection Induced Rebuffering Ratio (CIRR) | Under-reported | MediaElement, low bandwidth | When the video freezes due to lack of video data, Windows MediaElement on occasion does not start/report a buffering event until 20 seconds after the freeze. |
| Over-reported | Seek event | The player reports a seek event only when it has reached the requested seek point and is ready for playback. | |
| Under-reported | Media played after pause state while buffering | The player reports PLAYING state when played from PAUSED state during buffering. | |
| Rebuffering Ratio (RR) | Under-reported | MediaElement, low bandwidth | When the video freezes due to lack of video data, Windows MediaElement on occasion does not start/report a buffering event until 20 seconds after the freeze. |
| Under-reported | Media played after pause state while buffering | The player reports PLAYING state when played from PAUSED state during buffering. | |
| Video Restart Time (VRT) | Under-reported | Seek event | The player reports a seek event only when it has reached the requested seek point and is ready for playback. |
| Metadata Name | Impact | Conditions | Issue |
|---|---|---|---|
| Device Operating System | Incorrectly reported | Windows 11 | The device operating system for Windows 11 devices are detected as Windows 10. |
| Player Framework Version | Not reported | All | The Conviva library doesn't set this metadata. |
| Connection Type | Not reported | Xbox (Windows 11) | The connection type is not detected for Xbox devices running with Windows 11. |
| Screen Resolution | Not reported | Xbox | Screen resolution is not detected on Xbox devices. |
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.