# Nielsen DCR

ByteArk Player SDK for Android supports analytics through Nielsen DCR (Digital Content Ratings) (opens new window).

# Installation

Add the Nielsen Maven repository in settings.gradle (see Installation for the full setup):

pluginManagement {
  repositories {
    maven {
      url 'https://raw.githubusercontent.com/NielsenDigitalSDK/nielsenappsdk-android/master/'
    }
  }
}
1
2
3
4
5
6
7

# Configure Nielsen Setting

val nielsenSetting = ByteArkPlayerFragment.createNielsenSetting(
  "P1D9F153A-B0F5-43B9-A765-FF0330342DAD",  // App ID
  "ByteArk Demo",                            // App Name
  "1.0",                                      // SF Code
  "",
  "DEBUG"                                     // NolDevDebug
)
1
2
3
4
5
6
7

Or via builder:

val nielsenSetting = ByteArkNielsenSettingBuilder.Builder()
  .withAppId("P1D9F153A-B0F5-43B9-A765-FF0330342DAD")
  .withAppName("ByteArk Demo")
  .withSfCode("th")
  .withNolDevDebug("DEBUG")
  .build()
1
2
3
4
5
6
Builder method Type Description
withAppId(appId: String) String Nielsen App ID (contact Nielsen to obtain)
withAppName(appName: String) String Application name
withSfCode(sfCode: String) String Nielsen country SF Code ("th" for Thailand)
withNolDevDebug(debug: String) String "DEBUG" for development, "INFO" for production

# Send metadata per video

val nielsenMetaData = ByteArkNielsenMetaDataBuilder.Builder()
  .withChannelName("CHANNEL_NAME")
  .withClientId("CLIENT_ID")
  .withSubBrandId("SUBBRAND_ID")
  .withType("content")
  .withAssetId("ASSET_ID")
  .withProgram("PROGRAM_NAME")
  .withTitle("EPISODE_TITLE")
  .withLength(596L)        // Duration in seconds
  .withSegB("SegB")
  .withSegC("SegC")
  .withIsFullEpisode("y")  // "y" or "n"
  .withAdLoadType("2")     // "1" = Linear, "2" = Dynamic
  .build()
val playerItem = ByteArkPlayerItemBuilder.Builder()
  .withMediaId("VIDEO_ID")
  .withTitle("Big Buck Bunny")
  .withUrl("https://example.com/playlist.m3u8")
  .withByteArkNielsenMetaData(nielsenMetaData)
  .build()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

# Pass the setting to the player

mPlayerFragment = ByteArkPlayerFragment.createInstance(
  playerBuilder,
  mFragmentListener,
  companionAdSlot,
  nielsenSetting,
  playbackSetting,
  lighthouseSetting,
  chromeCastSetting
)
1
2
3
4
5
6
7
8
9