Class InsightUtil
java.lang.Object
com.nagra.otvaa.sdk.insightwrapper.InsightUtil
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic com.nagra.insight.agent.api.ContentInformation
getContent
(ContentInfoHolder xContentInfoHolder, WrapperConfig wrapperConfig, Boolean integrationMode) Converts the content information container into the new agent data structure.static com.nagra.insight.agent.api.ContentQuality
getContentQuality
(int width, int height) static com.nagra.insight.agent.InsightConfig
getInsightConfig
(Context context, String collectorUrl, Integer samplingInterval, Integer reportingPeriod, String appName, String appVersion, String deviceId, String deviceType, String operatorId, boolean integrationMode, String playerName, String playerVersion) Gets the InsightAgent configuration.static com.nagra.insight.agent.api.UserInfo
getUserInfo
(UserInfoHolder xUserInfoHolder) Converts the user information container into the new agent data structure.static boolean
isIntegrationVersion
(String sdkVersion) Detect if current sdk is integration versionstatic void
reportMediaPlayerError
(com.nagra.insight.agent.Agent agent, String errorCode, String errorMessage) Notifies the agent of a playback error if the error is detectedstatic com.nagra.insight.agent.InsightConfig
setDeviceIdInConfig
(Context context, com.nagra.insight.agent.InsightConfig insightConfig) Set deviceId in Insight Configstatic com.nagra.insight.agent.InsightConfig
setIntegrationMode
(com.nagra.insight.agent.InsightConfig insightConfig, boolean enableIntegrationMode) Set integration mode in Insight Config
-
Field Details
-
TAG
- See Also:
-
-
Method Details
-
getContent
public static com.nagra.insight.agent.api.ContentInformation getContent(ContentInfoHolder xContentInfoHolder, WrapperConfig wrapperConfig, Boolean integrationMode) throws RuntimeException Converts the content information container into the new agent data structure.- Parameters:
xContentInfoHolder
- content information definition for the old agentwrapperConfig
- agent wrapper configurationintegrationMode
- if set to true, it allows non valid operations to be detected during the integration by throwing some runtime exceptions. If set to false or null, then the errors will only be logged.- Returns:
- ContentInformation content information definition for the new agent
- Throws:
RuntimeException
-
getUserInfo
Converts the user information container into the new agent data structure.- Parameters:
xUserInfoHolder
- user information definition for the old agent- Returns:
- UserInfo user information definition for the new agent
-
getInsightConfig
public static com.nagra.insight.agent.InsightConfig getInsightConfig(Context context, String collectorUrl, Integer samplingInterval, Integer reportingPeriod, String appName, String appVersion, String deviceId, String deviceType, String operatorId, boolean integrationMode, String playerName, String playerVersion) Gets the InsightAgent configuration.
This utility method builds the configuration needed by the latest Insight Agent by only specifying the configuration parameters used by the legacy agent. The other InsightAgent parameters will be defined as follows:deviceManufacturer = Build.MANUFACTURER deviceModel = Build.MODEL osName ="Android" osVersion = Build.VERSION.RELEASE screenWidth = displayMetrics.widthPixels screenHeight = displayMetrics.heightPixels screenDensity = displayMetrics.densityDpi timezone = TimeZone.getDefault().getID() framedropsEnabled = true where displayMetrics = Resources.getSystem().getDisplayMetrics()
- Parameters:
context
- Player application contextcollectorUrl
- The endpoint of the Nagra Insight Collector servicesamplingInterval
- Amount of seconds between each metrics samplereportingPeriod
- Amount of seconds between each report that submits a collection of samples. (The actual reporting time should include a +-10% random jitter)appName
- The name of the applicationappVersion
- The version of the applicationdeviceId
- Device identifier. If the specified deviceId is null then the final value for the device ID will be set to Settings.Secure.ANDROID_ID.deviceType
- The type of device (handheld, desktop, stb)operatorId
- Operator token used to identify the tenantsintegrationMode
- if set to true, it allows non valid operations to be detected during the integration by throwing some runtime exceptions. If set to false then the errors will only be logged.
-
reportMediaPlayerError
public static void reportMediaPlayerError(com.nagra.insight.agent.Agent agent, String errorCode, String errorMessage) Notifies the agent of a playback error if the error is detected- Parameters:
agent
- the Insight agenterrorCode
- error codeerrorMessage
- error message
-
isIntegrationVersion
Detect if current sdk is integration version -
setIntegrationMode
public static com.nagra.insight.agent.InsightConfig setIntegrationMode(com.nagra.insight.agent.InsightConfig insightConfig, boolean enableIntegrationMode) Set integration mode in Insight Config- Parameters:
insightConfig
- the Insight config to set integration modeenableIntegrationMode
- integration mode
-
setDeviceIdInConfig
public static com.nagra.insight.agent.InsightConfig setDeviceIdInConfig(Context context, com.nagra.insight.agent.InsightConfig insightConfig) Set deviceId in Insight Config- Parameters:
context
- player application contextinsightConfig
- the Insight config to set device ID
-
getContentQuality
public static com.nagra.insight.agent.api.ContentQuality getContentQuality(int width, int height)
-