JW Player Plugin iOS
From Engineering Client Portal
Nielsen App SDK Plugin for JW Player interacts with Nielsen App SDK to provide with necessary data for streaming measurement based on the SDK events received from the JW Player SDK.
Supported Ad Frameworks
- VAST
Custom Support
For assistance, contact your Technical Account Manager
Plugin Implementation
Pre-requisites
- Nielsen SDK Configuration Form: Complete this form to receive the appid(s). The information on this form is required to set up the Content Management System (CMS) mapping for the app.
- Nielsen App ID (appid): A unique ID that Nielsen assigns to the site / player.
- Nielsen App SDK Plugin for JW Player: The download link for the Plugin Packages are provided with the Nielsen appid(s).
- JWPlayer SDK for iOS
- Test Environment Validation: Before moving the app into production, Nielsen must validate the Plugin’s integration in a test environment.
Initial Configuration
Before integrating our Plugin, make sure to download the following
- JW Player SDK for iOS
- Download JW Player SDK from JW Player's website https://dashboard.jwplayer.com/#/players/downloads
- Nielsen App SDK Plugin for JWPlayer, which includes
- Plugin Implementation Guide (this document)
- The Nielsen App SDK Plugin for JWPlayer source code and
- The sample application source code which supports JWPlayer VAST ad Plugin.
Initialization with Global Parameters
To initialize the Plugin that initializes the App SDK, pass the global parameters in JSON string format. Some of the global parameters are
- Nielsen App ID (appid)
- appversion
- appname
- sfcode
- dma
- ccode
- CMS Metadata
For more details refer to the Nielsen iOS SDK API Reference.
Setup
The steps for setting up the Nielsen App SDK Plugin for JWPlayer are as follows
Nielsen App SDK Plugin Package Installation
For FreeWheel ad support
- Unzip the NielsenJWPlayerPluginForiOS.zip
- Copy “NielsenAppApi.Framework” to the NielsenJWPlayerPluginForiOS/NielsenSampleAppVast folder.
- Download JWPlayer SDK from https://dashboard.jwplayer.com/#/players/downloads. The plugin has been tested with version 2.1.0.
- Copy “JWPlayer-iOS-SDK.framework” to the “NielsenJWPlayerPluginForiOS/NielsenSampleAppVast” folder
- Drag and drop “NielsenAppApi.Framework” and “JWPlayer-iOS-SDK.framework” to NielsenSampleAppVast project. Make sure frameworks are linked under Build Phases → Link Binary with Libraries
- click ‘+’ sign and add “NielsenAppApi.Framework” and “JWPlayer-iOS-SDK.framework”
- Build the app within the plugin
Nielsen App SDK Plugin Creation
The Nielsen App SDK Plugin for JWPlayer integrates with the JWPlayer SDK by listening for events from the player, other plugins and emits events for the player. It is also a wrapper for the Nielsen App SDK. It is registered with the JWPlayer SDK when it is instantiated by the application.
Perform the following steps in the app view controller, where the player is initialized
- Import PluginInstantiate the plugin and register it with an instance of ‘JWPlayerController’ based on the app information provided by Nielsen.
#import “NielsenJWPlayerPlugin.h”</syntaxhighligh> * Add Property<syntaxhighlight lang="objective-c">@property (nonatomic, strong) NielsenJWPlayerPlugin *nielsenJWPlayerPlugin;
self.nielsenJWPlayerPlugin = [[NielsenJWPlayerPlugin alloc] initWithAppInfo:@{@”appid”: @”MY_APP_ID”, @”appversion”: @”MY_APP_VERSION”, @”appname”: @”MY_APP_NAME”, @”sfcode”: @”MY_SFCODE”}; self.nielsenJWPlayerPlugin.dataSource = self; self.player.delegate = self.nielsenJWPlayerPlugin;
- Implement ‘NielsenJWPlayerDataSource’ delegate by adding the method as mentioned below:Plugin will call this method to fetch content metadata for the video.
– (NSDictionary *)contentMetadata;
Refer to the Reference Guide in the Nielsen SDK Documentation on the exact format of this dictionary. Set any key-value pair from the content metadata with an exception of ‘length’, ‘type’ and ‘title’, which are pre-set already.
- Add the following line of code (optional):
– (NSDictionary *)channelInfo;
Plugin calls this method to request for channel information associated with the video.
Refer to the Onboarding_Process in the Nielsen SDK Documentation on the exact format of this dictionary.
- Add the following line of code to notify App SDK that the remote OTT device (like Google ChromeCast, Roku, Amazon FireTV, etc.) is connected / disconnected (change of OTT status).
Refer to the Onboarding_Process in the Nielsen SDK Documentation for more information and example.
Opt-Out
The app needs to provide a way for the user to optout of metering. This is done by displaying Opt-Out page and passing the user’s response back to Nielsen, as described in the Onboarding_Process of the Nielsen SDK Documentation. The plugin exposes the ‘NielsenAppApi’, userOptOut and optOutURLString methods that are needed to interact with Opt-Out page.
-(BOOL)optOutStatus;
This API gets the current Nielsen opt-out state of AppSDK. Call this API to retrieve the Opt-Out or Opt-In state. Refer to the Onboarding_Process in the Nielsen SDK Documentation for more information and example.
SampleApp
Check NielsenJWPlayerSampleApp (NielsenJWPlayerSampleApp.tar.gz) to know about the usage of plugin and the Opt-Out page.
Releases
Name | Version # | Date | Comments |
---|---|---|---|
Nielsen AppSDK Plugin for JWPLayer (VAST) | 1.0.0 | 03/02/2016 | Initial version of the Nielsen App SDK Plugin for JWPlayer (iOS) with support for VAST ads. |
Nielsen AppSDK Plugin for JWPLayer (VAST) | 1.1.0 | 06/20/2016 | Reflects changes as per latest Nielsen App SDK v5.1.0.5 |