new OtvAnalyticsWrapper()
This class is a wrapper for the OtvAnalyticsAgent class.
It automates some OtvActivity detection using a Nagra Connect Player,
and forwards the detected activities to the OtvAnalyticsAgent.
Note: There is no need for the integrator to call
newon this class as it handled internally to the SDK.
Methods
-
appStart(metadata)
-
Submit the
appStartActivity Must be the first activity submitted (must be called before any other calls tosubmitActivity). Should not be called again without first submitting anappStopactivity.Name Type Description metadataObject Containing key-value pairs of metadata for the
appStartactivityReturns:
error object -
close()
-
Close the analytics session. After calling this method, do not call any other unless
initialiseis called againReturns:
error object -
initialise(wrapperConfig, agentConfig)
-
Initialise the OpenTv Analytics Agent and Wrapper. Call this method once, before calling any other. Do not call again unless
closeis called first.Name Type Description wrapperConfigObject Configuration for the wrapper
agentConfigObject Configuration for the
OtvAnalyticsAgentReturns:
error object -
playbackStart(metadata, insightContent, insightUserInfo)
-
Submit the
playbackStartActivity. Should be called after a player has been set for the wrapper.Name Type Description metadataObject Containing key-value pairs of metadata for the
playbackStartactivityinsightContentObject optional if insight reporting is required.
insightUserInfoObject optional if insight reporting is required but can still be omitted.
Returns:
error object -
setConnectPlayer(player)
-
Provide a reference to a Nagra Connect Player which may be used to automatically detect some activities, and populate some metadata. Must be called before submitting the
playbackStartactivity. Must not be changed or removed betweenplaybackStartandplaybackStopactivities. Player may be removed by passing anullreference.Name Type Description playerplayer Reference to a Nagra Connect Player
Returns:
error object -
submitActivity(activity, metadata)
-
Submit an activity.
appStartandplaybackStartactivities should not be submitted using this method.Name Type Description activityOtvActivity The activity being submitted
metadataObject Containing key-value pairs of metadata for the submitted activity
Returns:
error object -
updateConfig(updatedWrapperConfig, updatedAgentConfig)
-
Provide an updated configuration. The configuration object should only contain the updated attributes. Not all attributes may be updated. If either object does not need to be updated, an empty object
{}may be provided.Name Type Description updatedWrapperConfigObject updated configuration for the wrapper
updatedAgentConfigObject updated configuration for the
OtvAnalyticsAgentReturns:
error object