com.ooyala.android.nielsensdk.NielsenAnalytics Class Reference
Inheritance diagram for com.ooyala.android.nielsensdk.NielsenAnalytics:
com.ooyala.android.ID3TagNotifier.ID3TagNotifierListener

Public Member Functions

 NielsenAnalytics (Context context, OoyalaPlayer player, IAppNotifier iappNotifier, String appID, String appVersion, String appName, String sfCode, JSONObject customConfig, JSONObject customMetadata)
 Implementation of integration between Ooyala SDK and Nielsen AppSdk. More...
 
AppSdk getNielsenAppSdk ()
 Provides the AppSdk reference we are using internally, for use cases that aren't covered by this Class's interface. More...
 
void destroy ()
 Destroy the current NielsenAnalytics object. More...
 
boolean isValid ()
 This is mainly for internal use by NielsenAnalytics itself, but can be used to gate the use of NielsenAnalytics by clients. More...
 
void onMetadata (Metadata metadata)
 Handle the original metadata and send Nielsen ID3 metadata. More...
 
void update (Observable o, Object argN)
 update the player according to notification More...
 
void onMetadata (final Metadata metadata)
 Not guaranteed to be called on the main UI thread. More...
 

Constructor & Destructor Documentation

com.ooyala.android.nielsensdk.NielsenAnalytics.NielsenAnalytics ( Context  context,
OoyalaPlayer  player,
IAppNotifier  iappNotifier,
String  appID,
String  appVersion,
String  appName,
String  sfCode,
JSONObject  customConfig,
JSONObject  customMetadata 
)

Implementation of integration between Ooyala SDK and Nielsen AppSdk.

See the Nielsen SDK documentation around AppSdk.getInstance(). Note: When the client app goes into / resumes from the background, the app should destroy() this instance and create a new one via the constructor. See the lifecycle diagram in the Nielsen Android Developer's Guide.

Parameters
contextAndroid Context. Not null.
playerOoyalaPlayer. Not null.
iappNotifierper Nielsen SDK docs, optionally null.
appIDper Nielsen SDK docs. Not null.
appVersionper Nielsen SDK docs. Not null.
appNameper Nielsen SDK docs. Not null.
sfCodeper Nielsen SDK docs. Not null.
customConfig,optionallynull, is any custom JSON you want added into the config for Nielsen's AppSdk, such as longitude. (Note that Nielsen requires data to meet certain restrictions for valid strings.)
customMetadata,optionallynull, is any custom JSON you want added into the metadata for Nielsen's loadMetadata(). (Note that Nielsen requires data to meet certain restrictions for valid strings.) see AppSdk
See also
destroy()

Member Function Documentation

void com.ooyala.android.nielsensdk.NielsenAnalytics.destroy ( )

Destroy the current NielsenAnalytics object.

AppSdk com.ooyala.android.nielsensdk.NielsenAnalytics.getNielsenAppSdk ( )

Provides the AppSdk reference we are using internally, for use cases that aren't covered by this Class's interface.

In particular, the 3rd party application must register themselves as a listener on the AppSdk in order to wait for the EVENT_STARTUP event, after which the opt in/out URL will be available from the AppSdk.

Returns
our cached AppSdk ref, originally obtained by calling AppSdk.getInstance() in our constructor. see AppSdk::getInstance(Context, String) see AppSdk::EVENT_STARTUP
boolean com.ooyala.android.nielsensdk.NielsenAnalytics.isValid ( )

This is mainly for internal use by NielsenAnalytics itself, but can be used to gate the use of NielsenAnalytics by clients.

It implements a slightly more strict validation than the Nielsen AppSdk.isValid() method.

Returns
true if we are set up to report to Nielsen, false otherwise.
void com.ooyala.android.ID3TagNotifier.ID3TagNotifierListener.onMetadata ( final Metadata  metadata)
inherited

Not guaranteed to be called on the main UI thread.

When you implement this, consider posting a runnable on the main UI thread to do the actual work.

void com.ooyala.android.nielsensdk.NielsenAnalytics.onMetadata ( Metadata  metadata)

Handle the original metadata and send Nielsen ID3 metadata.

Parameters
metadataA collection of metadata entries
void com.ooyala.android.nielsensdk.NielsenAnalytics.update ( Observable  o,
Object  argN 
)

update the player according to notification

Parameters
othe player
argNnotification of the player