<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://engineeringportal.nielsen.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanielKrotov</id>
	<title>Engineering Client Portal - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://engineeringportal.nielsen.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=DanielKrotov"/>
	<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/wiki/Special:Contributions/DanielKrotov"/>
	<updated>2026-04-24T22:12:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=US_DCR_%26_DTVR&amp;diff=7133</id>
		<title>US DCR &amp; DTVR</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=US_DCR_%26_DTVR&amp;diff=7133"/>
		<updated>2024-12-09T17:58:59Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: Added a reference to the &amp;quot;Dual Instances&amp;quot; page.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
{{CategoryIcon|DCR.png|US Digital Content Ratings (DCR) &amp;amp; Digital in TV Ratings (DTVR)}}&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;| Start Here&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;7&amp;quot; |&lt;br /&gt;
| '''Step-By-Step SDK Integration Guides ([[BSDK Step By Step|Browser]], [[Android Step By Step|Android]], [[iOS Step By Step|iOS]])'''&lt;br /&gt;
| '''API Reference Tables ([[Browser_SDK_API_Table|Browser]], [[Android_SDK_API_Table|Android]], [[iOS_SDK_API_Table|iOS]])'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR_vs_DTVR|DCR vs. DTVR Implementation - Key Differences]]'''&lt;br /&gt;
| '''Product Information - [https://markets.nielsen.com/us/en/solutions/capabilities/digital-content-ratings/ DCR], [https://www.nielsen.com/solutions/audience-measurement/national-tv/ DTVR]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot;| General Reference&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Onboarding]]'''&lt;br /&gt;
| '''[[Digital Measurement Metadata]]'''&lt;br /&gt;
| '''[[Digital Measurement Testing]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Measurement Interruption Scenarios]]'''&lt;br /&gt;
| '''[[Digital Measurement FAQ]]'''&lt;br /&gt;
| '''SDK Release Notes - [[Browser_SDK_Release_Notes|Browser]], [[Android_SDK_Release_Notes|Android]], [[iOS_SDK_Release_Notes|iOS]], [[TVOS_SDK_Release_Notes|TVOS]], [[DOMless SDK Release Notes|DOMless]]'''&lt;br /&gt;
|-&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist App SDK]]'''&lt;br /&gt;
| '''[[Digital Pre-Certification Checklist Browser SDK]]'''&lt;br /&gt;
| '''[[Digital Measurement Persistent Identifiers]]'''&lt;br /&gt;
|-&lt;br /&gt;
|[[Dual Instances of SDK|'''Dual Instances of SDK''']]&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Video ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Maintaining an existing ''DCR'' or ''DTVR'' App integration? Continue to reference the API you're already using with the guides below.&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
! style=&amp;quot;width: 30%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
! style=&amp;quot;width: 25%;&amp;quot; | DTVR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;4&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Video iOS SDK]]'''&lt;br /&gt;
| '''[[DTVR iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Video Android SDK]]'''&lt;br /&gt;
| '''[[DTVR Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Video Browser SDK]]'''&lt;br /&gt;
| '''[[DTVR Browser SDK]]'''&lt;br /&gt;
| [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
|{{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
|'''[[DCR Video Domless SDK]]'''&lt;br /&gt;
|'''[[DTVR Domless SDK]]'''&lt;br /&gt;
|[[Domless SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Static ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
! style=&amp;quot;width: 55%;&amp;quot; | DCR Implementation Guide&lt;br /&gt;
!| SDK Documentation&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
| rowspan=&amp;quot;9&amp;quot; | {{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR Static iOS SDK]]'''&lt;br /&gt;
| [[iOS SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR Static Android SDK]]'''&lt;br /&gt;
| [[Android SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;2&amp;quot; | {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR Static Browser SDK]]'''&lt;br /&gt;
| rowspan=&amp;quot;5&amp;quot; | [[Browser SDK API Reference]]&lt;br /&gt;
|-&lt;br /&gt;
| '''[[DCR Static Lite Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|GoogleTagManagerIcon.png|alt=Google Tag Manager}}&lt;br /&gt;
| '''[[DCR Static Google Tag Manager]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|FacebookIcon.png|alt=Facebook Instant Articles}}&lt;br /&gt;
| '''[[DCR Static Facebook Instant Articles Browser SDK]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|Tealium_Icon.png|alt=Tealium}}&lt;br /&gt;
| '''[[DCR Static Tealium]]'''&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|AMPIcon.png|alt=Google AMP}}&lt;br /&gt;
| '''[[DCR Static Google AMP Cloud API]]'''&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|{{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
|'''[[DCR Static Domless SDK]]'''&lt;br /&gt;
|[[Domless SDK API Reference]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Xamarin ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Xamarin Integration Guides (Xamarin support is part of [[Special:Downloads|Nielsen's AppSDK V8]] and above.)&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|  {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Xamarin}}&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[DCR_%26_DTVR_Xamarin_Integration|DCR &amp;amp; DTVR Xamarin Integration]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Cloud API ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| DCR Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{SmallIcon|CloudAPIIcon.png|alt=Cloud API}} &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&lt;br /&gt;
{{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
{{OSIcon|StaticIcon.png|alt=Static Content}}&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Cloud API ]]''' &lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|APIIcon.png|alt=Cloud API}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Mobile Cloud API ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|RokuIcon.png|alt=Roku}}&lt;br /&gt;
| '''[[DCR Video &amp;amp; Static Roku Cloud API]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Adobe Launch Extensions ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | Leverage Launch by Adobe? The guides below describe how to integrate DCR and DTVR with Nielsen's Adobe Launch extension&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
!| Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; | '''[[Digital Measurement Onboarding Adobe ]]'''&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|macOSIcon.png|alt=iOS}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR iOS Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|AndroidIcon.png|alt=Android}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Android Adobe Launch Extension]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[DCR &amp;amp; DTVR Browser Adobe Launch Extension]]'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== SDK - Connected TV ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;6&amp;quot; | The guides below describe how to integrate DCR and DTVR with Smart tv's&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 90px;&amp;quot; | Type&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; |&lt;br /&gt;
! style=&amp;quot;width: 45px;&amp;quot; | OS&lt;br /&gt;
! | Implementation Guide&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;8&amp;quot; | {{SmallIcon|SDKIcon.png|alt=SDK}}&lt;br /&gt;
|-&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; | {{OSIcon|VideoIcon.png|alt=Video}}&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[Digital Measurement Video TizenTv]]'''&lt;br /&gt;
|-&lt;br /&gt;
| {{OSIcon|BrowserIcon.png|alt=Browser}}&lt;br /&gt;
| '''[[Digital Measurement Video webOS]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=Dual_Instances_of_SDK&amp;diff=7132</id>
		<title>Dual Instances of SDK</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=Dual_Instances_of_SDK&amp;diff=7132"/>
		<updated>2024-12-09T17:55:33Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: /* Parent Page (index.html */ Added forgotten parenthesis&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Multiple SDK Instances ==&lt;br /&gt;
&lt;br /&gt;
=== SDK Initialization ===&lt;br /&gt;
&lt;br /&gt;
==== App SDK ====&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
A maximum of four SDK instances per appid are supported.&lt;br /&gt;
When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
==== Browser SDK ====&lt;br /&gt;
The Browser SDK allows instantiating multiple instances of the object, which can be used simultaneously without any problems, however they must be instantiated with their own unique instance names. There is no maximum number of instances that is enforced in the browser.&lt;br /&gt;
&lt;br /&gt;
=== App SDK Examples ===&lt;br /&gt;
&lt;br /&gt;
==== Example using Swift ====&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;In this example we create a swift file called NielsenInit where I store our SDK Initialization code.  The example uses 2 APPIDS to keep everything organized.  &lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 self.nielsenStaticApi = NielsenInit.createStaticNielsenApi(delegate: self)&lt;br /&gt;
 self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Here are the methods in the NielsenInit class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit : NSObject {&lt;br /&gt;
&lt;br /&gt;
    class func createNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
        let appInformation:[String: String] = [          &lt;br /&gt;
&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788BC65XXX&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;Standard SDK Swift Sample&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;dcr&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;INFO&amp;quot;&lt;br /&gt;
        ]     &lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }  &lt;br /&gt;
&lt;br /&gt;
    class func createStaticNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
 &lt;br /&gt;
        let appInformation:[String: String] = [&lt;br /&gt;
&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PE4A57F64-878D-4D69-8EFB-4E87C27BXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;Standard SDK Swift Sample&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;dcr&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;INFO&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;We then load up the Static and Content metadata in our sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func loadStatic() -&amp;gt; [String : Any] {&lt;br /&gt;
        //Loading Static data&lt;br /&gt;
        let staticData =&lt;br /&gt;
        [&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
            &amp;quot;section&amp;quot;: &amp;quot;siteSection&amp;quot;,&lt;br /&gt;
            &amp;quot;segA&amp;quot;: &amp;quot;segmentA&amp;quot;,&lt;br /&gt;
            &amp;quot;segB&amp;quot;: &amp;quot;segmentB&amp;quot;,&lt;br /&gt;
            &amp;quot;segC&amp;quot;: &amp;quot;segmentC&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return staticData&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    func loadContent() -&amp;gt; [String : Any] {&lt;br /&gt;
        //Loading Content data&lt;br /&gt;
        url = NSURL(string: &amp;quot;http://www.nielseninternet.com/NielsenConsumer/prog_index.m3u8&amp;quot;)&lt;br /&gt;
        let content = [&lt;br /&gt;
            &amp;quot;type&amp;quot;:&amp;quot;content&amp;quot;,&lt;br /&gt;
            &amp;quot;assetid&amp;quot;:&amp;quot;C77664&amp;quot;,&lt;br /&gt;
            &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;:&amp;quot;MyProgram&amp;quot;,&lt;br /&gt;
            &amp;quot;segB&amp;quot;:&amp;quot;CustomSegmentValueB&amp;quot;,&lt;br /&gt;
            &amp;quot;segC&amp;quot;:&amp;quot;segmentC&amp;quot;,&lt;br /&gt;
            &amp;quot;title&amp;quot;:&amp;quot;S2,E3&amp;quot;,&lt;br /&gt;
            &amp;quot;section&amp;quot;:&amp;quot;cloudApi_app&amp;quot;,&lt;br /&gt;
            &amp;quot;airdate&amp;quot;:&amp;quot;20180221 10:00:00&amp;quot;,&lt;br /&gt;
            &amp;quot;isfullepisode&amp;quot;:&amp;quot;y&amp;quot;,&lt;br /&gt;
            &amp;quot;adloadtype&amp;quot;:&amp;quot;2&amp;quot;,&lt;br /&gt;
            &amp;quot;channelName&amp;quot;:&amp;quot;My Channel 1&amp;quot;,&lt;br /&gt;
            &amp;quot;pipMode&amp;quot;:&amp;quot;false&amp;quot; ] as [String : Any]&lt;br /&gt;
&lt;br /&gt;
        return content&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;In AppDelegate, we initialize the 1st instance of the SDK for Static Measurement when the App launches.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&amp;gt; Bool {&lt;br /&gt;
        // Override point for customization after application launch.&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsenStaticApi = NielsenInit.createStaticNielsenApi(delegate: self)&lt;br /&gt;
        sdkMethods = SDKMethods()&lt;br /&gt;
        self.data = sdkMethods.loadStatic()&lt;br /&gt;
        self.nielsenStaticApi.loadMetadata(self.data)&lt;br /&gt;
        return true&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Now for the Player Instance, we initialize in the ViewController, but only after the View has loaded:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
        self.view.backgroundColor = UIColor(patternImage: UIImage(named: &amp;quot;new_ios_bg.png&amp;quot;)!)&lt;br /&gt;
        //In NielsenInit class we are initialising the NielsenApi.&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsencontentApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can just call them separately:&lt;br /&gt;
&lt;br /&gt;
For example, App goes into the background:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func applicationDidEnterBackground(_ application: UIApplication) {&lt;br /&gt;
&lt;br /&gt;
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.&lt;br /&gt;
&lt;br /&gt;
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.&lt;br /&gt;
        self.nielsenStaticApi.loadMetadata(self.data)&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Or sending the playhead position to the second instance:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
nielsencontentApi.play(sdkMethods.loadChannelInfo())          &lt;br /&gt;
self.nielsencontentApi?.playheadPosition(pos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example using Android Studio ====&lt;br /&gt;
[https://engineeringportal.nielsen.com/w/downloads/digital/sampleapplications/SimplePlayerStandardWithStaticAndroidSDK.zip Download Project Files]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The below is an example of Initializing two instances of the Nielsen SDK.  One for Static Measurement, and the other for Video Measurement.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
public class NielsenInit {&lt;br /&gt;
&lt;br /&gt;
    private AppSdk mAppSdk = null;&lt;br /&gt;
    private AppSdk mStaticAppSdk = null;&lt;br /&gt;
&lt;br /&gt;
    public AppSdk initAppSdk(Context mContext, IAppNotifier appNotifier){&lt;br /&gt;
        try {&lt;br /&gt;
            //Initialising the NielsenAppSDK class by passing app information which returns the instance of AppSdk.&lt;br /&gt;
&lt;br /&gt;
            JSONObject appInformation = new JSONObject()&lt;br /&gt;
&lt;br /&gt;
                    .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788BC65XXX&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;sfcode&amp;quot;, &amp;quot;dcr&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;INFO&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            mAppSdk = new AppSdk(mContext, appInformation, appNotifier);&lt;br /&gt;
        } catch (JSONException e) {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        return mAppSdk;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public AppSdk initStaticAppSdk(Context mContext, IAppNotifier appNotifier){&lt;br /&gt;
        try {&lt;br /&gt;
            //Initialising the NielsenAppSDK class by passing app information which returns the instance of AppSdk.&lt;br /&gt;
&lt;br /&gt;
            JSONObject appInformation = new JSONObject()&lt;br /&gt;
&lt;br /&gt;
                    .put(&amp;quot;appid&amp;quot;, &amp;quot;PE4A57F64-878D-4D69-8EFB-4E87C27BAXXX&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;sfcode&amp;quot;, &amp;quot;dcr&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;INFO&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            mStaticAppSdk = new AppSdk(mContext, appInformation, appNotifier);&lt;br /&gt;
        } catch (JSONException e) {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        return mStaticAppSdk;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
&lt;br /&gt;
        //3rd parameter &amp;quot;this&amp;quot; referes to IAppNotifier interface which is needed to initialise NielsenSDK.&lt;br /&gt;
        staticAppSdk = nielsenInit.initStaticAppSdk(MyApplication.getContext(), this);&lt;br /&gt;
        data = sdkMethods.loadStaticData();&lt;br /&gt;
&lt;br /&gt;
  if(this.b == 0) {&lt;br /&gt;
                        AppLaunchMeasurementManager.appInBackground(app.getApplicationContext());&lt;br /&gt;
                        staticAppSdk.loadMetadata(data);&lt;br /&gt;
                        Log.d(&amp;quot;SdkBgFgDetectionUtility&amp;quot;, &amp;quot;App going to background&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
        //Getting the instance of NielsenSDK.&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
&lt;br /&gt;
        //3rd parameter &amp;quot;this&amp;quot; referes to IAppNotifier interface which is needed to initialise NielsenSDK.&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser SDK Examples ===&lt;br /&gt;
The below examples will make use of the same AppId, however using different AppIds will work as well. The principles below follow the same initialization rules as a single instance and simply require a unique instance name and variable name with which the returned instance is assigned. &lt;br /&gt;
&lt;br /&gt;
For more information around the possible parameters that can be passed as well as deeper descriptions for the API calls, please refer to our API documentation here: [[Browser SDK API Reference]]&lt;br /&gt;
&lt;br /&gt;
==== Example of 2 instances on the same page ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//Add Static Queue Snippet&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    !function (e, n) {&lt;br /&gt;
      function t(e) {&lt;br /&gt;
        return &amp;quot;object&amp;quot; == typeof e ? JSON.parse(JSON.stringify(e)) : e&lt;br /&gt;
      }&lt;br /&gt;
      e[n] = e[n] ||&lt;br /&gt;
      {&lt;br /&gt;
        nlsQ: function (o, r, c) {&lt;br /&gt;
          var s = e.document,&lt;br /&gt;
            a = s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
          a.async = 1,&lt;br /&gt;
            a.src = (&amp;quot;http:&amp;quot; === e.location.protocol ? &amp;quot;http:&amp;quot; : &amp;quot;https:&amp;quot;) + &amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot; + o + &amp;quot;.js#name=&amp;quot; + r + &amp;quot;&amp;amp;ns=&amp;quot; + n;&lt;br /&gt;
          var i = s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
          return i.parentNode.insertBefore(a, i),&lt;br /&gt;
            e[n][r] = e[n][r] || {&lt;br /&gt;
              g: c || {},&lt;br /&gt;
              ggPM: function (o, c, s, a, i) { e[n][r].q = e[n][r].q || []; try { var l = t([o, c, s, a, i]); e[n][r].q.push(l) } catch (e) { console &amp;amp;&amp;amp; console.log &amp;amp;&amp;amp; console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;) } },&lt;br /&gt;
              trackEvent: function (o) { e[n][r].te = e[n][r].te || []; try { var c = t(o); e[n][r].te.push(c) } catch (e) { console &amp;amp;&amp;amp; console.log &amp;amp;&amp;amp; console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;) } }&lt;br /&gt;
            },&lt;br /&gt;
            e[n][r]&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }(window, &amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    //Create SDK Instance(s)&lt;br /&gt;
    // Notice the unique instance name given to each instance below and the unique variable name for each instance&lt;br /&gt;
    var nSdkInstanceLive = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;instanceLive&amp;quot;, {&lt;br /&gt;
        nol_sdkDebug: 'debug',&lt;br /&gt;
        optout: 'false'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    var nSdkInstanceVod = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;instanceVod&amp;quot;, {&lt;br /&gt;
        nol_sdkDebug: 'debug',&lt;br /&gt;
        optout: 'false'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example of 2 instances using a parent page and iFrame ====&lt;br /&gt;
&lt;br /&gt;
===== Parent Page (index.html) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;ie=edge&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;DCR Static/DCR Video&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    /* NLSQUEUE build v*/&lt;br /&gt;
    !function(e,n){&lt;br /&gt;
    function t(e){&lt;br /&gt;
      return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
    }&lt;br /&gt;
    e[n]=e[n]||&lt;br /&gt;
    {&lt;br /&gt;
      nlsQ:function(o,r,c){&lt;br /&gt;
        var s=e.document,&lt;br /&gt;
        a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
        a.async=1,&lt;br /&gt;
        a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
        var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
        return i.parentNode.insertBefore(a,i),&lt;br /&gt;
        e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
        ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
        trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
        e[n][r]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // SDK Initialization&lt;br /&gt;
    var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;staticPage&amp;quot;, {&lt;br /&gt;
      nol_sdkDebug: 'debug',&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    // Static Metadata &lt;br /&gt;
    var staticMetadata = {&lt;br /&gt;
      assetid: 'staticTestPage',&lt;br /&gt;
      type: 'static'&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    // Event 'staticstart' call&lt;br /&gt;
    nSdkInstance.ggPM(14, staticMetadata);&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;h1&amp;gt;DCR Static on Parent/DCR Video in iFrame&amp;lt;/h1&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Static measurement is current on parent page when window is in focus&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;iframe src=&amp;quot;./dcr-video.html&amp;quot; frameborder=&amp;quot;0&amp;quot; width=&amp;quot;650&amp;quot; height=&amp;quot;500&amp;quot; style=&amp;quot;background-color: rgb(42, 217, 248);&amp;quot; id=&amp;quot;video-iframe&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Nested iFrame Referenced on Parent Page (dcr-video.html) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;ie=edge&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;iFrame Same Source&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
    /* NLSQUEUE build v*/&lt;br /&gt;
    !function(e,n){&lt;br /&gt;
      function t(e){&lt;br /&gt;
        return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
      }&lt;br /&gt;
      e[n]=e[n]||&lt;br /&gt;
      {&lt;br /&gt;
        nlsQ:function(o,r,c){&lt;br /&gt;
          var s=e.document,&lt;br /&gt;
          a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
          a.async=1,&lt;br /&gt;
          a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
          var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
          return i.parentNode.insertBefore(a,i),&lt;br /&gt;
          e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
          ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
          trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
          e[n][r]&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // SDK Initialization&lt;br /&gt;
    var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;videoPlayer&amp;quot;, {&lt;br /&gt;
      nol_sdkDebug: 'debug',&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    var contentMetadata = {&lt;br /&gt;
        type: &amp;quot;content&amp;quot;,&lt;br /&gt;
        length: &amp;quot;300&amp;quot;,&lt;br /&gt;
        title: &amp;quot;Skydiving Across Europe&amp;quot;,&lt;br /&gt;
        program: &amp;quot;latacg&amp;quot;,&lt;br /&gt;
        censuscategory: &amp;quot;Enlisted&amp;quot;,&lt;br /&gt;
        assetid: &amp;quot;204558915992&amp;quot;,&lt;br /&gt;
        section: &amp;quot;ProgramAsset8&amp;quot;,&lt;br /&gt;
        tv: &amp;quot;true&amp;quot;,&lt;br /&gt;
        adModel: &amp;quot;0&amp;quot;,&lt;br /&gt;
        dataSrc: &amp;quot;cms&amp;quot;,&lt;br /&gt;
        segA: &amp;quot;S07E04:NBC&amp;quot;,&lt;br /&gt;
        segB: &amp;quot;teams&amp;quot;,&lt;br /&gt;
        segC:&amp;quot;AtlanataFalcons&amp;quot;,&lt;br /&gt;
      }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;I'm iframe SDK DCR Video measurement, DCR static measurement should continue when clicking &amp;quot;play&amp;quot; on video&amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;main&amp;gt;&lt;br /&gt;
      &amp;lt;video&lt;br /&gt;
      controls&lt;br /&gt;
      src=&amp;quot;https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4&amp;quot;&lt;br /&gt;
      poster=&amp;quot;https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217&amp;quot;&lt;br /&gt;
      width=&amp;quot;620&amp;quot;&amp;gt;&lt;br /&gt;
      Sorry, your browser doesn't support embedded videos, but don't worry, you can&lt;br /&gt;
      &amp;lt;a href=&amp;quot;https://archive.org/details/BigBuckBunny_124&amp;quot;&amp;gt;download it&amp;lt;/a&amp;gt;&lt;br /&gt;
      and watch it with your favorite video player!&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;/main&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;../player.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=Dual_Instances_of_SDK&amp;diff=7131</id>
		<title>Dual Instances of SDK</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=Dual_Instances_of_SDK&amp;diff=7131"/>
		<updated>2024-12-09T17:54:05Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: Added examples to reference for Browser SDK multi-instance implementations.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Breadcrumb|}} {{Breadcrumb|Digital}} {{Breadcrumb|DCR &amp;amp; DTVR}}  {{CurrentBreadcrumb}}&lt;br /&gt;
[[Category:Digital]]&lt;br /&gt;
&lt;br /&gt;
== Multiple SDK Instances ==&lt;br /&gt;
&lt;br /&gt;
=== SDK Initialization ===&lt;br /&gt;
&lt;br /&gt;
==== App SDK ====&lt;br /&gt;
The latest version of the Nielsen App SDK allows instantiating multiple instances of the SDK object, which can be used simultaneously without any issue. The sharedInstance API that creates a singleton object was deprecated prior to version 5.1.1. (Version 4.0 for Android)&lt;br /&gt;
&lt;br /&gt;
A maximum of four SDK instances per appid are supported.&lt;br /&gt;
When four SDK instances exist, you must destroy an old instance before creating a new one.&lt;br /&gt;
&lt;br /&gt;
==== Browser SDK ====&lt;br /&gt;
The Browser SDK allows instantiating multiple instances of the object, which can be used simultaneously without any problems, however they must be instantiated with their own unique instance names. There is no maximum number of instances that is enforced in the browser.&lt;br /&gt;
&lt;br /&gt;
=== App SDK Examples ===&lt;br /&gt;
&lt;br /&gt;
==== Example using Swift ====&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;In this example we create a swift file called NielsenInit where I store our SDK Initialization code.  The example uses 2 APPIDS to keep everything organized.  &lt;br /&gt;
&amp;lt;p&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
 self.nielsenStaticApi = NielsenInit.createStaticNielsenApi(delegate: self)&lt;br /&gt;
 self.nielsenApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Here are the methods in the NielsenInit class.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
class NielsenInit : NSObject {&lt;br /&gt;
&lt;br /&gt;
    class func createNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
        let appInformation:[String: String] = [          &lt;br /&gt;
&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788BC65XXX&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;Standard SDK Swift Sample&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;dcr&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;INFO&amp;quot;&lt;br /&gt;
        ]     &lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }  &lt;br /&gt;
&lt;br /&gt;
    class func createStaticNielsenApi(delegate: NielsenAppApiDelegate) -&amp;gt; NielsenAppApi?{&lt;br /&gt;
 &lt;br /&gt;
        let appInformation:[String: String] = [&lt;br /&gt;
&lt;br /&gt;
            &amp;quot;appid&amp;quot;: &amp;quot;PE4A57F64-878D-4D69-8EFB-4E87C27BXXXX&amp;quot;,&lt;br /&gt;
            &amp;quot;appname&amp;quot;: &amp;quot;Standard SDK Swift Sample&amp;quot;,&lt;br /&gt;
            &amp;quot;appversion&amp;quot;: &amp;quot;1.0&amp;quot;,&lt;br /&gt;
            &amp;quot;sfcode&amp;quot;: &amp;quot;dcr&amp;quot;,&lt;br /&gt;
            &amp;quot;nol_devDebug&amp;quot;: &amp;quot;INFO&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return NielsenAppApi(appInfo:appInformation, delegate:delegate)&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;We then load up the Static and Content metadata in our sample:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func loadStatic() -&amp;gt; [String : Any] {&lt;br /&gt;
        //Loading Static data&lt;br /&gt;
        let staticData =&lt;br /&gt;
        [&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;static&amp;quot;,&lt;br /&gt;
            &amp;quot;section&amp;quot;: &amp;quot;siteSection&amp;quot;,&lt;br /&gt;
            &amp;quot;segA&amp;quot;: &amp;quot;segmentA&amp;quot;,&lt;br /&gt;
            &amp;quot;segB&amp;quot;: &amp;quot;segmentB&amp;quot;,&lt;br /&gt;
            &amp;quot;segC&amp;quot;: &amp;quot;segmentC&amp;quot;&lt;br /&gt;
        ]&lt;br /&gt;
        return staticData&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    func loadContent() -&amp;gt; [String : Any] {&lt;br /&gt;
        //Loading Content data&lt;br /&gt;
        url = NSURL(string: &amp;quot;http://www.nielseninternet.com/NielsenConsumer/prog_index.m3u8&amp;quot;)&lt;br /&gt;
        let content = [&lt;br /&gt;
            &amp;quot;type&amp;quot;:&amp;quot;content&amp;quot;,&lt;br /&gt;
            &amp;quot;assetid&amp;quot;:&amp;quot;C77664&amp;quot;,&lt;br /&gt;
            &amp;quot;length&amp;quot;:&amp;quot;3600&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;:&amp;quot;MyProgram&amp;quot;,&lt;br /&gt;
            &amp;quot;segB&amp;quot;:&amp;quot;CustomSegmentValueB&amp;quot;,&lt;br /&gt;
            &amp;quot;segC&amp;quot;:&amp;quot;segmentC&amp;quot;,&lt;br /&gt;
            &amp;quot;title&amp;quot;:&amp;quot;S2,E3&amp;quot;,&lt;br /&gt;
            &amp;quot;section&amp;quot;:&amp;quot;cloudApi_app&amp;quot;,&lt;br /&gt;
            &amp;quot;airdate&amp;quot;:&amp;quot;20180221 10:00:00&amp;quot;,&lt;br /&gt;
            &amp;quot;isfullepisode&amp;quot;:&amp;quot;y&amp;quot;,&lt;br /&gt;
            &amp;quot;adloadtype&amp;quot;:&amp;quot;2&amp;quot;,&lt;br /&gt;
            &amp;quot;channelName&amp;quot;:&amp;quot;My Channel 1&amp;quot;,&lt;br /&gt;
            &amp;quot;pipMode&amp;quot;:&amp;quot;false&amp;quot; ] as [String : Any]&lt;br /&gt;
&lt;br /&gt;
        return content&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;In AppDelegate, we initialize the 1st instance of the SDK for Static Measurement when the App launches.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -&amp;gt; Bool {&lt;br /&gt;
        // Override point for customization after application launch.&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsenStaticApi = NielsenInit.createStaticNielsenApi(delegate: self)&lt;br /&gt;
        sdkMethods = SDKMethods()&lt;br /&gt;
        self.data = sdkMethods.loadStatic()&lt;br /&gt;
        self.nielsenStaticApi.loadMetadata(self.data)&lt;br /&gt;
        return true&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Now for the Player Instance, we initialize in the ViewController, but only after the View has loaded:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    override func viewDidLoad() {&lt;br /&gt;
        super.viewDidLoad()&lt;br /&gt;
        self.view.backgroundColor = UIColor(patternImage: UIImage(named: &amp;quot;new_ios_bg.png&amp;quot;)!)&lt;br /&gt;
        //In NielsenInit class we are initialising the NielsenApi.&lt;br /&gt;
&lt;br /&gt;
        //Getting the instance of NielsenApi&lt;br /&gt;
        self.nielsencontentApi = NielsenInit.createNielsenApi(delegate: self)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can just call them separately:&lt;br /&gt;
&lt;br /&gt;
For example, App goes into the background:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
    func applicationDidEnterBackground(_ application: UIApplication) {&lt;br /&gt;
&lt;br /&gt;
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.&lt;br /&gt;
&lt;br /&gt;
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.&lt;br /&gt;
        self.nielsenStaticApi.loadMetadata(self.data)&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;Or sending the playhead position to the second instance:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;swift&amp;quot;&amp;gt;&lt;br /&gt;
nielsencontentApi.play(sdkMethods.loadChannelInfo())          &lt;br /&gt;
self.nielsencontentApi?.playheadPosition(pos);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example using Android Studio ====&lt;br /&gt;
[https://engineeringportal.nielsen.com/w/downloads/digital/sampleapplications/SimplePlayerStandardWithStaticAndroidSDK.zip Download Project Files]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;The below is an example of Initializing two instances of the Nielsen SDK.  One for Static Measurement, and the other for Video Measurement.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
public class NielsenInit {&lt;br /&gt;
&lt;br /&gt;
    private AppSdk mAppSdk = null;&lt;br /&gt;
    private AppSdk mStaticAppSdk = null;&lt;br /&gt;
&lt;br /&gt;
    public AppSdk initAppSdk(Context mContext, IAppNotifier appNotifier){&lt;br /&gt;
        try {&lt;br /&gt;
            //Initialising the NielsenAppSDK class by passing app information which returns the instance of AppSdk.&lt;br /&gt;
&lt;br /&gt;
            JSONObject appInformation = new JSONObject()&lt;br /&gt;
&lt;br /&gt;
                    .put(&amp;quot;appid&amp;quot;, &amp;quot;PDA7D5EE6-B1B8-4123-9277-2A788BC65XXX&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;sfcode&amp;quot;, &amp;quot;dcr&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;INFO&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            mAppSdk = new AppSdk(mContext, appInformation, appNotifier);&lt;br /&gt;
        } catch (JSONException e) {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        return mAppSdk;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public AppSdk initStaticAppSdk(Context mContext, IAppNotifier appNotifier){&lt;br /&gt;
        try {&lt;br /&gt;
            //Initialising the NielsenAppSDK class by passing app information which returns the instance of AppSdk.&lt;br /&gt;
&lt;br /&gt;
            JSONObject appInformation = new JSONObject()&lt;br /&gt;
&lt;br /&gt;
                    .put(&amp;quot;appid&amp;quot;, &amp;quot;PE4A57F64-878D-4D69-8EFB-4E87C27BAXXX&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;appversion&amp;quot;, &amp;quot;1.0&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;sfcode&amp;quot;, &amp;quot;dcr&amp;quot;)&lt;br /&gt;
                    .put(&amp;quot;nol_devDebug&amp;quot;, &amp;quot;INFO&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
            mStaticAppSdk = new AppSdk(mContext, appInformation, appNotifier);&lt;br /&gt;
        } catch (JSONException e) {&lt;br /&gt;
            e.printStackTrace();&lt;br /&gt;
        }&lt;br /&gt;
        return mStaticAppSdk;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
&lt;br /&gt;
        //3rd parameter &amp;quot;this&amp;quot; referes to IAppNotifier interface which is needed to initialise NielsenSDK.&lt;br /&gt;
        staticAppSdk = nielsenInit.initStaticAppSdk(MyApplication.getContext(), this);&lt;br /&gt;
        data = sdkMethods.loadStaticData();&lt;br /&gt;
&lt;br /&gt;
  if(this.b == 0) {&lt;br /&gt;
                        AppLaunchMeasurementManager.appInBackground(app.getApplicationContext());&lt;br /&gt;
                        staticAppSdk.loadMetadata(data);&lt;br /&gt;
                        Log.d(&amp;quot;SdkBgFgDetectionUtility&amp;quot;, &amp;quot;App going to background&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=java&amp;gt;&lt;br /&gt;
        //Getting the instance of NielsenSDK.&lt;br /&gt;
        NielsenInit nielsenInit = new NielsenInit();&lt;br /&gt;
&lt;br /&gt;
        //3rd parameter &amp;quot;this&amp;quot; referes to IAppNotifier interface which is needed to initialise NielsenSDK.&lt;br /&gt;
        appSdk = nielsenInit.initAppSdk(getApplicationContext(), this);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Browser SDK Examples ===&lt;br /&gt;
The below examples will make use of the same AppId, however using different AppIds will work as well. The principles below follow the same initialization rules as a single instance and simply require a unique instance name and variable name with which the returned instance is assigned. &lt;br /&gt;
&lt;br /&gt;
For more information around the possible parameters that can be passed as well as deeper descriptions for the API calls, please refer to our API documentation here: [[Browser SDK API Reference]]&lt;br /&gt;
&lt;br /&gt;
==== Example of 2 instances on the same page ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//Add Static Queue Snippet&lt;br /&gt;
&amp;lt;script&amp;gt;&lt;br /&gt;
    !function (e, n) {&lt;br /&gt;
      function t(e) {&lt;br /&gt;
        return &amp;quot;object&amp;quot; == typeof e ? JSON.parse(JSON.stringify(e)) : e&lt;br /&gt;
      }&lt;br /&gt;
      e[n] = e[n] ||&lt;br /&gt;
      {&lt;br /&gt;
        nlsQ: function (o, r, c) {&lt;br /&gt;
          var s = e.document,&lt;br /&gt;
            a = s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
          a.async = 1,&lt;br /&gt;
            a.src = (&amp;quot;http:&amp;quot; === e.location.protocol ? &amp;quot;http:&amp;quot; : &amp;quot;https:&amp;quot;) + &amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot; + o + &amp;quot;.js#name=&amp;quot; + r + &amp;quot;&amp;amp;ns=&amp;quot; + n;&lt;br /&gt;
          var i = s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
          return i.parentNode.insertBefore(a, i),&lt;br /&gt;
            e[n][r] = e[n][r] || {&lt;br /&gt;
              g: c || {},&lt;br /&gt;
              ggPM: function (o, c, s, a, i) { e[n][r].q = e[n][r].q || []; try { var l = t([o, c, s, a, i]); e[n][r].q.push(l) } catch (e) { console &amp;amp;&amp;amp; console.log &amp;amp;&amp;amp; console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;) } },&lt;br /&gt;
              trackEvent: function (o) { e[n][r].te = e[n][r].te || []; try { var c = t(o); e[n][r].te.push(c) } catch (e) { console &amp;amp;&amp;amp; console.log &amp;amp;&amp;amp; console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;) } }&lt;br /&gt;
            },&lt;br /&gt;
            e[n][r]&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }(window, &amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    //Create SDK Instance(s)&lt;br /&gt;
    // Notice the unique instance name given to each instance below and the unique variable name for each instance&lt;br /&gt;
    var nSdkInstanceLive = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;instanceLive&amp;quot;, {&lt;br /&gt;
        nol_sdkDebug: 'debug',&lt;br /&gt;
        optout: 'false'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    var nSdkInstanceVod = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;instanceVod&amp;quot;, {&lt;br /&gt;
        nol_sdkDebug: 'debug',&lt;br /&gt;
        optout: 'false'&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example of 2 instances using a parent page and iFrame ====&lt;br /&gt;
&lt;br /&gt;
===== Parent Page (index.html =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
  &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;ie=edge&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;title&amp;gt;DCR Static/DCR Video&amp;lt;/title&amp;gt;&lt;br /&gt;
  &amp;lt;script&amp;gt;&lt;br /&gt;
    /* NLSQUEUE build v*/&lt;br /&gt;
    !function(e,n){&lt;br /&gt;
    function t(e){&lt;br /&gt;
      return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
    }&lt;br /&gt;
    e[n]=e[n]||&lt;br /&gt;
    {&lt;br /&gt;
      nlsQ:function(o,r,c){&lt;br /&gt;
        var s=e.document,&lt;br /&gt;
        a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
        a.async=1,&lt;br /&gt;
        a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
        var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
        return i.parentNode.insertBefore(a,i),&lt;br /&gt;
        e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
        ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
        trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
        e[n][r]&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // SDK Initialization&lt;br /&gt;
    var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;staticPage&amp;quot;, {&lt;br /&gt;
      nol_sdkDebug: 'debug',&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    // Static Metadata &lt;br /&gt;
    var staticMetadata = {&lt;br /&gt;
      assetid: 'staticTestPage',&lt;br /&gt;
      type: 'static'&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    // Event 'staticstart' call&lt;br /&gt;
    nSdkInstance.ggPM(14, staticMetadata);&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
  &amp;lt;h1&amp;gt;DCR Static on Parent/DCR Video in iFrame&amp;lt;/h1&amp;gt;&lt;br /&gt;
  &amp;lt;p&amp;gt;Static measurement is current on parent page when window is in focus&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;iframe src=&amp;quot;./dcr-video.html&amp;quot; frameborder=&amp;quot;0&amp;quot; width=&amp;quot;650&amp;quot; height=&amp;quot;500&amp;quot; style=&amp;quot;background-color: rgb(42, 217, 248);&amp;quot; id=&amp;quot;video-iframe&amp;quot;&amp;gt;&amp;lt;/iframe&amp;gt;&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Nested iFrame Referenced on Parent Page (dcr-video.html) =====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;html&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
&amp;lt;html lang=&amp;quot;en&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;head&amp;gt;&lt;br /&gt;
    &amp;lt;meta charset=&amp;quot;UTF-8&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;meta name=&amp;quot;viewport&amp;quot; content=&amp;quot;width=device-width, initial-scale=1.0&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;meta http-equiv=&amp;quot;X-UA-Compatible&amp;quot; content=&amp;quot;ie=edge&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;title&amp;gt;iFrame Same Source&amp;lt;/title&amp;gt;&lt;br /&gt;
    &amp;lt;script&amp;gt;&lt;br /&gt;
    /* NLSQUEUE build v*/&lt;br /&gt;
    !function(e,n){&lt;br /&gt;
      function t(e){&lt;br /&gt;
        return&amp;quot;object&amp;quot;==typeof e?JSON.parse(JSON.stringify(e)):e&lt;br /&gt;
      }&lt;br /&gt;
      e[n]=e[n]||&lt;br /&gt;
      {&lt;br /&gt;
        nlsQ:function(o,r,c){&lt;br /&gt;
          var s=e.document,&lt;br /&gt;
          a=s.createElement(&amp;quot;script&amp;quot;);&lt;br /&gt;
          a.async=1,&lt;br /&gt;
          a.src=(&amp;quot;http:&amp;quot;===e.location.protocol?&amp;quot;http:&amp;quot;:&amp;quot;https:&amp;quot;)+&amp;quot;//cdn-gl.imrworldwide.com/conf/&amp;quot;+o+&amp;quot;.js#name=&amp;quot;+r+&amp;quot;&amp;amp;ns=&amp;quot;+n;&lt;br /&gt;
          var i=s.getElementsByTagName(&amp;quot;script&amp;quot;)[0];&lt;br /&gt;
          return i.parentNode.insertBefore(a,i),&lt;br /&gt;
          e[n][r]=e[n][r]||{g:c||{},&lt;br /&gt;
          ggPM:function(o,c,s,a,i){e[n][r].q=e[n][r].q||[];try{var l=t([o,c,s,a,i]);e[n][r].q.push(l)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}},&lt;br /&gt;
          trackEvent:function(o){e[n][r].te=e[n][r].te||[];try{var c=t(o);e[n][r].te.push(c)}catch(e){console&amp;amp;&amp;amp;console.log&amp;amp;&amp;amp;console.log(&amp;quot;Error: Cannot register event in Nielsen SDK queue.&amp;quot;)}}},&lt;br /&gt;
          e[n][r]&lt;br /&gt;
        }&lt;br /&gt;
      }&lt;br /&gt;
    }(window,&amp;quot;NOLBUNDLE&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // SDK Initialization&lt;br /&gt;
    var nSdkInstance = NOLBUNDLE.nlsQ(&amp;quot;XXXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX&amp;quot;, &amp;quot;videoPlayer&amp;quot;, {&lt;br /&gt;
      nol_sdkDebug: 'debug',&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
    var contentMetadata = {&lt;br /&gt;
        type: &amp;quot;content&amp;quot;,&lt;br /&gt;
        length: &amp;quot;300&amp;quot;,&lt;br /&gt;
        title: &amp;quot;Skydiving Across Europe&amp;quot;,&lt;br /&gt;
        program: &amp;quot;latacg&amp;quot;,&lt;br /&gt;
        censuscategory: &amp;quot;Enlisted&amp;quot;,&lt;br /&gt;
        assetid: &amp;quot;204558915992&amp;quot;,&lt;br /&gt;
        section: &amp;quot;ProgramAsset8&amp;quot;,&lt;br /&gt;
        tv: &amp;quot;true&amp;quot;,&lt;br /&gt;
        adModel: &amp;quot;0&amp;quot;,&lt;br /&gt;
        dataSrc: &amp;quot;cms&amp;quot;,&lt;br /&gt;
        segA: &amp;quot;S07E04:NBC&amp;quot;,&lt;br /&gt;
        segB: &amp;quot;teams&amp;quot;,&lt;br /&gt;
        segC:&amp;quot;AtlanataFalcons&amp;quot;,&lt;br /&gt;
      }&lt;br /&gt;
  &amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/head&amp;gt;&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
    &amp;lt;p&amp;gt;I'm iframe SDK DCR Video measurement, DCR static measurement should continue when clicking &amp;quot;play&amp;quot; on video&amp;lt;/p&amp;gt;&lt;br /&gt;
    &amp;lt;main&amp;gt;&lt;br /&gt;
      &amp;lt;video&lt;br /&gt;
      controls&lt;br /&gt;
      src=&amp;quot;https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4&amp;quot;&lt;br /&gt;
      poster=&amp;quot;https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217&amp;quot;&lt;br /&gt;
      width=&amp;quot;620&amp;quot;&amp;gt;&lt;br /&gt;
      Sorry, your browser doesn't support embedded videos, but don't worry, you can&lt;br /&gt;
      &amp;lt;a href=&amp;quot;https://archive.org/details/BigBuckBunny_124&amp;quot;&amp;gt;download it&amp;lt;/a&amp;gt;&lt;br /&gt;
      and watch it with your favorite video player!&lt;br /&gt;
    &amp;lt;/video&amp;gt;&lt;br /&gt;
    &amp;lt;/main&amp;gt;&lt;br /&gt;
    &amp;lt;script src=&amp;quot;../player.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
  &amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7100</id>
		<title>DCR Video Domless SDK</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7100"/>
		<updated>2024-10-29T13:29:39Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: /* Nielsen Debug Node.js Server for Event Tracking */ Updated with TAM entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==License==&lt;br /&gt;
Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [[Special:ClickThrough|here]], which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).&lt;br /&gt;
==DOM-less SDK DCR Video Introduction==&lt;br /&gt;
The Nielsen DOM-less SDK is a Javascript based cross-platform library that clients can use to integrate the Nielsen Digital Content Rating or Digital TV Rating measurement in apps for dom-less platforms like ReactNative, NodeJS etc. apps.&lt;br /&gt;
&lt;br /&gt;
The Digital Content Ratings (DCR) Video product provides content consumption measurement on client mobile apps or webpages. This measurement includes insight into the total time a user spent watching the tracked content, video player events, and much more. This example provides the steps to implement the DCR Video product in a sample NodeJS app. It includes:&lt;br /&gt;
*DOM-less SDK Initialization&lt;br /&gt;
*DCR Video Metadata: information about the content being tracked&lt;br /&gt;
*DCR Video Events/API calls&lt;br /&gt;
By the end of this guide you will have the needed steps to integrate Nielsen's DOM-less SDK in your app.&lt;br /&gt;
===DOM-less SDK DCR Video Step 1 - Obtain AppID===&lt;br /&gt;
To begin using the DOM-less SDK you will need to obtain an Application ID (AppId)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Item&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
|-&lt;br /&gt;
|✅&lt;br /&gt;
|App ID (appid)&lt;br /&gt;
|Unique ID assigned to the player/site and configured by product&lt;br /&gt;
|Contact your Nielsen TAM&lt;br /&gt;
|}The appid is a 37 character unique ID assigned to the player/site and configured by product and is required when creating a new instance of the DOM-less SDK on the app.&lt;br /&gt;
&lt;br /&gt;
Example: '''PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX'''&lt;br /&gt;
===DOM-less SDK DCR Video Step 2 - SDK Initialization===&lt;br /&gt;
This project is an API that allows clients to integrate the Nielsen SDK in DOM-less environments like React Native, NodeJS, etc.&lt;br /&gt;
&lt;br /&gt;
Refer to the &amp;quot;[[Domless SDK API Reference#DOM-less SDK Initialization| DOM-less SDK initialization]] &amp;quot; section in the [[Domless SDK API Reference| DOM-less SDK API Reference Guide]].&lt;br /&gt;
====SDK Initialization====&lt;br /&gt;
The following table contains the list of arguments that can be passed&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter / Argument&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
!Required?&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|appid&lt;br /&gt;
|Unique Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you.&lt;br /&gt;
|Nielsen-specified&lt;br /&gt;
|Yes&lt;br /&gt;
|PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
|instanceName&lt;br /&gt;
|DOM-less SDK instance name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|String eg. abcdefg&lt;br /&gt;
|-&lt;br /&gt;
|appName&lt;br /&gt;
|Application name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|appName: 'BSDK RN Sample App'&lt;br /&gt;
|-&lt;br /&gt;
|deviceId&lt;br /&gt;
|Device ID&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|deviceId: '38400000-8cf0-11bd-b23e-10b96e40000d'&lt;br /&gt;
|-&lt;br /&gt;
|nol_sdkDebug&lt;br /&gt;
|Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|Client-provided&lt;br /&gt;
|No&lt;br /&gt;
|nol_sdkDebug: 'debug'&lt;br /&gt;
|-&lt;br /&gt;
|domlessEnv&lt;br /&gt;
|Specify the domless environment.&lt;br /&gt;
&amp;quot;1&amp;quot; for ReactNative &amp;quot;2&amp;quot; for Amazon &amp;quot;3&amp;quot; for NodeJS &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
|Client-provided&lt;br /&gt;
|Yes&lt;br /&gt;
|domlessEnv: '1'&lt;br /&gt;
|}&lt;br /&gt;
====Nielsen Debug Node.js Server for Event Tracking====&lt;br /&gt;
We are excited to announce the beta version of our Debug Node.js server, designed to track requests and events sent from our Dom-less SDK using WebSocket connections. While this feature is not officially released, we are currently looking for users interested in beta testing. &lt;br /&gt;
&lt;br /&gt;
If you'd like to try this tool and provide feedback, please reach out to your Nielsen Technical Account Manager (TAM) for more information. Your insights would be invaluable in helping us refine this feature for a future release!&lt;br /&gt;
&lt;br /&gt;
===DOM-less SDK DCR Video Step 3 - Create DCR Video Content Metadata Object===&lt;br /&gt;
====Events that can be passed to `ggPM` method====&lt;br /&gt;
1. &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; - This event is used to send DCR Video metadata to the Nielsen SDK. This event should be called when the video metadata is loaded.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    instance.ggPM('loadMetadata', {&lt;br /&gt;
&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;setPlayheadPosition&amp;lt;/code&amp;gt; - This event is used to send the current playhead position to the Nielsen SDK. This event should be called when the video is playing.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('setPlayheadPosition', 10);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; - This event is used to send the end event to the Nielsen SDK. This event should be called when the video playback is finished, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('end', 300);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;4. &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; - This event is used to send the stop event to the Nielsen SDK. This event should be called when transitioning from ads to content and content to ads, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('stop', 120);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;5. &amp;lt;code&amp;gt;updateMetadata&amp;lt;/code&amp;gt; - This event allows updating metadata for the content or ad that is being played. This event cannot be used to update values for type, vidtype, or assetid parameters.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('updateMetadata', {&lt;br /&gt;
       length: 90,&lt;br /&gt;
       segC: &amp;quot;My segC&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
======Events that can be passed to and processed by &amp;lt;code&amp;gt;processEvent&amp;lt;/code&amp;gt; method======&lt;br /&gt;
1. &amp;lt;code&amp;gt;`blur`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the background.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'blur', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;`focus`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the foreground.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'focus', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;`appclose`&amp;lt;/code&amp;gt; - This event should be passed prior to closing the app.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'appclose', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===DOM-less SDK DCR Video Step 4 - Basic Set of Events - Sample Playback===&lt;br /&gt;
====Sample Nielsen BSDK-Domless NodeJS Example====&lt;br /&gt;
*[https://github.com/NielsenDigitalSDK/bsdk-domless-samples/tree/main/nodejs Nielsen bsdk-domless NodeJS Example]&lt;br /&gt;
====Sample DCR Video Integration====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import { BsdkInstance } from 'bsdk-domless';&lt;br /&gt;
&lt;br /&gt;
const nsdkConfig = {&lt;br /&gt;
    app_id: 'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',&lt;br /&gt;
    instance_name: 'videoInstance',&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const implementationHooks = {&lt;br /&gt;
    Log: {&lt;br /&gt;
             info: function (log: string) {&lt;br /&gt;
         		        console.info(log);&lt;br /&gt;
		     },&lt;br /&gt;
		     debug: function (log: string) {&lt;br /&gt;
                        console.debug(log);&lt;br /&gt;
		     },&lt;br /&gt;
             warn: function (log: string) {&lt;br /&gt;
                        console.warn(log);&lt;br /&gt;
		     },&lt;br /&gt;
             error: function (error: string) {&lt;br /&gt;
                        console.error(error);&lt;br /&gt;
		     } &lt;br /&gt;
	     },&lt;br /&gt;
	Storage: {&lt;br /&gt;
		setItem: async function (key: any, value: string) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Sets a string value for given key. This operation can either modify an existing entry,&lt;br /&gt;
             * if it did exist for given key, or add new one otherwise.&lt;br /&gt;
             * In order to store object value, you need to serialize it, e.g. using JSON.stringify().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		getItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Gets a string value for given key. This function can either return a string value for &lt;br /&gt;
             * existing key or return null otherwise.&lt;br /&gt;
             * In order to store object value, you need to deserialize it, e.g. using JSON.parse().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		removeItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Removes item for a key, invokes (optional) callback once completed.&lt;br /&gt;
            */&lt;br /&gt;
        }&lt;br /&gt;
	  },&lt;br /&gt;
	Fetch: async function (url: string | URL | Request, options: any) {&lt;br /&gt;
        /**&lt;br /&gt;
        * We require that client pass in User-Agent header via options in Fetch request&lt;br /&gt;
        */&lt;br /&gt;
        const clientOpts = {&lt;br /&gt;
			headers: {&lt;br /&gt;
				&amp;quot;User-Agent&amp;quot;: &amp;quot;react-native-domless/1.6.7.42 Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X)&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		const data = Object.assign(options, clientOpts);&lt;br /&gt;
		const response = await fetch(url, data);&lt;br /&gt;
		if (response.ok) {&lt;br /&gt;
			return response;&lt;br /&gt;
		} else {&lt;br /&gt;
			throw new Error('Request failed');&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
    SetTimeout: function (callback: () =&amp;gt; void, timeout: number | undefined) {&lt;br /&gt;
        return setTimeout(callback, timeout);	},&lt;br /&gt;
    SetInterval: function (callback: () =&amp;gt; void, interval: number | undefined) {&lt;br /&gt;
        return setInterval(callback, interval);&lt;br /&gt;
    },&lt;br /&gt;
    ClearTimeout: function (timeout: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearTimeout(timeout);&lt;br /&gt;
    },&lt;br /&gt;
    ClearInterval: function (interval: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearInterval(interval);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const nSdkInstance = new BsdkInstance(&lt;br /&gt;
    nsdkConfig.app_id,&lt;br /&gt;
    nsdkConfig.instance_name,&lt;br /&gt;
    {&lt;br /&gt;
        appName: 'BSDK RN Sample App',&lt;br /&gt;
        deviceId: 'testDeviceId',&lt;br /&gt;
        nol_sdkDebug: 'debug', // remove debug flag when going to production&lt;br /&gt;
        domlessEnv: // &amp;quot;1&amp;quot; for React Native | &amp;quot;2&amp;quot; for Amazon | &amp;quot;3&amp;quot; for NodeJS | &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
        // reference SDK interface documentation&lt;br /&gt;
        // for additonal metadata properties&lt;br /&gt;
    },&lt;br /&gt;
    implementationHooks );&lt;br /&gt;
&lt;br /&gt;
// Sample VideoPlayer component &lt;br /&gt;
const VideoPlayer = (props) =&amp;gt; {&lt;br /&gt;
/**&lt;br /&gt;
* Implementation of video player component will vary across the board, for Nielsen DOM-less SDK integration&lt;br /&gt;
* clients need only setup event listeners with corresponding ggPM() calls.&lt;br /&gt;
* &lt;br /&gt;
* Please refer to chosen video player documentation on available events&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
const video = useRef&amp;lt;Video&amp;gt;(null);&lt;br /&gt;
let previousPlayhead = 0; // keep track of previous playhead position&lt;br /&gt;
let metadataLoaded = false; // in case of replay scenario set flag for metadata load&lt;br /&gt;
&lt;br /&gt;
// Sample video metadata&lt;br /&gt;
const videometadata = {&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
const setUpEventListeners = (): void =&amp;gt; {&lt;br /&gt;
     video.addEventListener('ended', onEnded);&lt;br /&gt;
     video.addEventListener('timeupdate', onTimeUpdate);&lt;br /&gt;
     video.addEventListener('playing', onPlay);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onEnded = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'end' event&lt;br /&gt;
    if (nSdkInstance) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('end', Math.round(video.currentTime));&lt;br /&gt;
            metadataLoaded = false;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onTimeUpdate = () =&amp;gt; {&lt;br /&gt;
    const currPlayhead = Math.round(video.current?.currentTime!);&lt;br /&gt;
    if (currPlayhead &amp;gt; 0 &amp;amp;&amp;amp; currPlayhead !== previousPlayhead) {&lt;br /&gt;
        previousPlayhead = currPlayhead;&lt;br /&gt;
        // Nielsen SDK ggPM 'setPlayheadPosition' event&lt;br /&gt;
        if (nSdkInstance) {&lt;br /&gt;
            nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
                instance.ggPM('setPlayheadPosition', currPlayhead);&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// NOTE: some players may have an event when video metadata is loaded, recommended to use if available. E.g. loadedmetadata&lt;br /&gt;
const onPlay = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'loadmetadata' event&lt;br /&gt;
    if (nSdkInstance &amp;amp;&amp;amp; !metadataLoaded) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('loadMetadata', videometadata);&lt;br /&gt;
            metadataLoaded = true;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
return (&lt;br /&gt;
       &amp;lt;View&amp;gt;&lt;br /&gt;
          &amp;lt;Video&lt;br /&gt;
                 source={{ uri: 'https://www.w3schools.com/html/mov_bbb.mp4' }}&lt;br /&gt;
             /&amp;gt;&lt;br /&gt;
      &amp;lt;/View&amp;gt;&lt;br /&gt;
  );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7099</id>
		<title>DCR Video Domless SDK</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7099"/>
		<updated>2024-10-25T17:06:03Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: /* DOM-less SDK DCR Video Step 2 - SDK Initialization */ Added note for Debug Node server.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==License==&lt;br /&gt;
Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [[Special:ClickThrough|here]], which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).&lt;br /&gt;
==DOM-less SDK DCR Video Introduction==&lt;br /&gt;
The Nielsen DOM-less SDK is a Javascript based cross-platform library that clients can use to integrate the Nielsen Digital Content Rating or Digital TV Rating measurement in apps for dom-less platforms like ReactNative, NodeJS etc. apps.&lt;br /&gt;
&lt;br /&gt;
The Digital Content Ratings (DCR) Video product provides content consumption measurement on client mobile apps or webpages. This measurement includes insight into the total time a user spent watching the tracked content, video player events, and much more. This example provides the steps to implement the DCR Video product in a sample NodeJS app. It includes:&lt;br /&gt;
*DOM-less SDK Initialization&lt;br /&gt;
*DCR Video Metadata: information about the content being tracked&lt;br /&gt;
*DCR Video Events/API calls&lt;br /&gt;
By the end of this guide you will have the needed steps to integrate Nielsen's DOM-less SDK in your app.&lt;br /&gt;
===DOM-less SDK DCR Video Step 1 - Obtain AppID===&lt;br /&gt;
To begin using the DOM-less SDK you will need to obtain an Application ID (AppId)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Item&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
|-&lt;br /&gt;
|✅&lt;br /&gt;
|App ID (appid)&lt;br /&gt;
|Unique ID assigned to the player/site and configured by product&lt;br /&gt;
|Contact your Nielsen TAM&lt;br /&gt;
|}The appid is a 37 character unique ID assigned to the player/site and configured by product and is required when creating a new instance of the DOM-less SDK on the app.&lt;br /&gt;
&lt;br /&gt;
Example: '''PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX'''&lt;br /&gt;
===DOM-less SDK DCR Video Step 2 - SDK Initialization===&lt;br /&gt;
This project is an API that allows clients to integrate the Nielsen SDK in DOM-less environments like React Native, NodeJS, etc.&lt;br /&gt;
&lt;br /&gt;
Refer to the &amp;quot;[[Domless SDK API Reference#DOM-less SDK Initialization| DOM-less SDK initialization]] &amp;quot; section in the [[Domless SDK API Reference| DOM-less SDK API Reference Guide]].&lt;br /&gt;
====SDK Initialization====&lt;br /&gt;
The following table contains the list of arguments that can be passed&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter / Argument&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
!Required?&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|appid&lt;br /&gt;
|Unique Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you.&lt;br /&gt;
|Nielsen-specified&lt;br /&gt;
|Yes&lt;br /&gt;
|PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
|instanceName&lt;br /&gt;
|DOM-less SDK instance name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|String eg. abcdefg&lt;br /&gt;
|-&lt;br /&gt;
|appName&lt;br /&gt;
|Application name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|appName: 'BSDK RN Sample App'&lt;br /&gt;
|-&lt;br /&gt;
|deviceId&lt;br /&gt;
|Device ID&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|deviceId: '38400000-8cf0-11bd-b23e-10b96e40000d'&lt;br /&gt;
|-&lt;br /&gt;
|nol_sdkDebug&lt;br /&gt;
|Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|Client-provided&lt;br /&gt;
|No&lt;br /&gt;
|nol_sdkDebug: 'debug'&lt;br /&gt;
|-&lt;br /&gt;
|domlessEnv&lt;br /&gt;
|Specify the domless environment.&lt;br /&gt;
&amp;quot;1&amp;quot; for ReactNative &amp;quot;2&amp;quot; for Amazon &amp;quot;3&amp;quot; for NodeJS &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
|Client-provided&lt;br /&gt;
|Yes&lt;br /&gt;
|domlessEnv: '1'&lt;br /&gt;
|}&lt;br /&gt;
====Nielsen Debug Node.js Server for Event Tracking====&lt;br /&gt;
We are excited to announce the beta version of our Debug Node.js server, designed to track messages and events sent from our Dom-less SDK using WebSocket connections. While this feature is not officially released, we are currently looking for users interested in beta testing. &lt;br /&gt;
&lt;br /&gt;
If you'd like to try this tool and provide feedback, please reach out to Nielsen representative for more information. Your insights would be invaluable in helping us refine this feature for a future release!&lt;br /&gt;
===DOM-less SDK DCR Video Step 3 - Create DCR Video Content Metadata Object===&lt;br /&gt;
====Events that can be passed to `ggPM` method====&lt;br /&gt;
1. &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; - This event is used to send DCR Video metadata to the Nielsen SDK. This event should be called when the video metadata is loaded.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    instance.ggPM('loadMetadata', {&lt;br /&gt;
&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;setPlayheadPosition&amp;lt;/code&amp;gt; - This event is used to send the current playhead position to the Nielsen SDK. This event should be called when the video is playing.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('setPlayheadPosition', 10);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; - This event is used to send the end event to the Nielsen SDK. This event should be called when the video playback is finished, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('end', 300);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;4. &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; - This event is used to send the stop event to the Nielsen SDK. This event should be called when transitioning from ads to content and content to ads, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('stop', 120);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;5. &amp;lt;code&amp;gt;updateMetadata&amp;lt;/code&amp;gt; - This event allows updating metadata for the content or ad that is being played. This event cannot be used to update values for type, vidtype, or assetid parameters.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('updateMetadata', {&lt;br /&gt;
       length: 90,&lt;br /&gt;
       segC: &amp;quot;My segC&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
======Events that can be passed to and processed by &amp;lt;code&amp;gt;processEvent&amp;lt;/code&amp;gt; method======&lt;br /&gt;
1. &amp;lt;code&amp;gt;`blur`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the background.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'blur', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;`focus`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the foreground.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'focus', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;`appclose`&amp;lt;/code&amp;gt; - This event should be passed prior to closing the app.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'appclose', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===DOM-less SDK DCR Video Step 4 - Basic Set of Events - Sample Playback===&lt;br /&gt;
====Sample Nielsen BSDK-Domless NodeJS Example====&lt;br /&gt;
*[https://github.com/NielsenDigitalSDK/bsdk-domless-samples/tree/main/nodejs Nielsen bsdk-domless NodeJS Example]&lt;br /&gt;
====Sample DCR Video Integration====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import { BsdkInstance } from 'bsdk-domless';&lt;br /&gt;
&lt;br /&gt;
const nsdkConfig = {&lt;br /&gt;
    app_id: 'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',&lt;br /&gt;
    instance_name: 'videoInstance',&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const implementationHooks = {&lt;br /&gt;
    Log: {&lt;br /&gt;
             info: function (log: string) {&lt;br /&gt;
         		        console.info(log);&lt;br /&gt;
		     },&lt;br /&gt;
		     debug: function (log: string) {&lt;br /&gt;
                        console.debug(log);&lt;br /&gt;
		     },&lt;br /&gt;
             warn: function (log: string) {&lt;br /&gt;
                        console.warn(log);&lt;br /&gt;
		     },&lt;br /&gt;
             error: function (error: string) {&lt;br /&gt;
                        console.error(error);&lt;br /&gt;
		     } &lt;br /&gt;
	     },&lt;br /&gt;
	Storage: {&lt;br /&gt;
		setItem: async function (key: any, value: string) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Sets a string value for given key. This operation can either modify an existing entry,&lt;br /&gt;
             * if it did exist for given key, or add new one otherwise.&lt;br /&gt;
             * In order to store object value, you need to serialize it, e.g. using JSON.stringify().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		getItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Gets a string value for given key. This function can either return a string value for &lt;br /&gt;
             * existing key or return null otherwise.&lt;br /&gt;
             * In order to store object value, you need to deserialize it, e.g. using JSON.parse().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		removeItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Removes item for a key, invokes (optional) callback once completed.&lt;br /&gt;
            */&lt;br /&gt;
        }&lt;br /&gt;
	  },&lt;br /&gt;
	Fetch: async function (url: string | URL | Request, options: any) {&lt;br /&gt;
        /**&lt;br /&gt;
        * We require that client pass in User-Agent header via options in Fetch request&lt;br /&gt;
        */&lt;br /&gt;
        const clientOpts = {&lt;br /&gt;
			headers: {&lt;br /&gt;
				&amp;quot;User-Agent&amp;quot;: &amp;quot;react-native-domless/1.6.7.42 Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X)&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		const data = Object.assign(options, clientOpts);&lt;br /&gt;
		const response = await fetch(url, data);&lt;br /&gt;
		if (response.ok) {&lt;br /&gt;
			return response;&lt;br /&gt;
		} else {&lt;br /&gt;
			throw new Error('Request failed');&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
    SetTimeout: function (callback: () =&amp;gt; void, timeout: number | undefined) {&lt;br /&gt;
        return setTimeout(callback, timeout);	},&lt;br /&gt;
    SetInterval: function (callback: () =&amp;gt; void, interval: number | undefined) {&lt;br /&gt;
        return setInterval(callback, interval);&lt;br /&gt;
    },&lt;br /&gt;
    ClearTimeout: function (timeout: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearTimeout(timeout);&lt;br /&gt;
    },&lt;br /&gt;
    ClearInterval: function (interval: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearInterval(interval);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const nSdkInstance = new BsdkInstance(&lt;br /&gt;
    nsdkConfig.app_id,&lt;br /&gt;
    nsdkConfig.instance_name,&lt;br /&gt;
    {&lt;br /&gt;
        appName: 'BSDK RN Sample App',&lt;br /&gt;
        deviceId: 'testDeviceId',&lt;br /&gt;
        nol_sdkDebug: 'debug', // remove debug flag when going to production&lt;br /&gt;
        domlessEnv: // &amp;quot;1&amp;quot; for React Native | &amp;quot;2&amp;quot; for Amazon | &amp;quot;3&amp;quot; for NodeJS | &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
        // reference SDK interface documentation&lt;br /&gt;
        // for additonal metadata properties&lt;br /&gt;
    },&lt;br /&gt;
    implementationHooks );&lt;br /&gt;
&lt;br /&gt;
// Sample VideoPlayer component &lt;br /&gt;
const VideoPlayer = (props) =&amp;gt; {&lt;br /&gt;
/**&lt;br /&gt;
* Implementation of video player component will vary across the board, for Nielsen DOM-less SDK integration&lt;br /&gt;
* clients need only setup event listeners with corresponding ggPM() calls.&lt;br /&gt;
* &lt;br /&gt;
* Please refer to chosen video player documentation on available events&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
const video = useRef&amp;lt;Video&amp;gt;(null);&lt;br /&gt;
let previousPlayhead = 0; // keep track of previous playhead position&lt;br /&gt;
let metadataLoaded = false; // in case of replay scenario set flag for metadata load&lt;br /&gt;
&lt;br /&gt;
// Sample video metadata&lt;br /&gt;
const videometadata = {&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
const setUpEventListeners = (): void =&amp;gt; {&lt;br /&gt;
     video.addEventListener('ended', onEnded);&lt;br /&gt;
     video.addEventListener('timeupdate', onTimeUpdate);&lt;br /&gt;
     video.addEventListener('playing', onPlay);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onEnded = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'end' event&lt;br /&gt;
    if (nSdkInstance) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('end', Math.round(video.currentTime));&lt;br /&gt;
            metadataLoaded = false;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onTimeUpdate = () =&amp;gt; {&lt;br /&gt;
    const currPlayhead = Math.round(video.current?.currentTime!);&lt;br /&gt;
    if (currPlayhead &amp;gt; 0 &amp;amp;&amp;amp; currPlayhead !== previousPlayhead) {&lt;br /&gt;
        previousPlayhead = currPlayhead;&lt;br /&gt;
        // Nielsen SDK ggPM 'setPlayheadPosition' event&lt;br /&gt;
        if (nSdkInstance) {&lt;br /&gt;
            nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
                instance.ggPM('setPlayheadPosition', currPlayhead);&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// NOTE: some players may have an event when video metadata is loaded, recommended to use if available. E.g. loadedmetadata&lt;br /&gt;
const onPlay = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'loadmetadata' event&lt;br /&gt;
    if (nSdkInstance &amp;amp;&amp;amp; !metadataLoaded) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('loadMetadata', videometadata);&lt;br /&gt;
            metadataLoaded = true;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
return (&lt;br /&gt;
       &amp;lt;View&amp;gt;&lt;br /&gt;
          &amp;lt;Video&lt;br /&gt;
                 source={{ uri: 'https://www.w3schools.com/html/mov_bbb.mp4' }}&lt;br /&gt;
             /&amp;gt;&lt;br /&gt;
      &amp;lt;/View&amp;gt;&lt;br /&gt;
  );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
	<entry>
		<id>https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7097</id>
		<title>DCR Video Domless SDK</title>
		<link rel="alternate" type="text/html" href="https://engineeringportal.nielsen.com/w/index.php?title=DCR_Video_Domless_SDK&amp;diff=7097"/>
		<updated>2024-10-23T20:35:29Z</updated>

		<summary type="html">&lt;p&gt;DanielKrotov: /* SDK Initialization */ Added Debug Node Server params&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==License==&lt;br /&gt;
Nielsen SDK contains material that is protected by copyright laws, patent laws, trade secret laws, and by international treaty provisions and is Copyright © 2024 The Nielsen Company (US) LLC. All intellectual property rights and licenses therein are reserved by The Nielsen Company (US) LLC and its licensors. Please read the license agreement presented [[Special:ClickThrough|here]], which must be accepted in order to download the Nielsen SDKs. For more information, reach out to your Nielsen Technical Account Manager(TAM).&lt;br /&gt;
==DOM-less SDK DCR Video Introduction==&lt;br /&gt;
The Nielsen DOM-less SDK is a Javascript based cross-platform library that clients can use to integrate the Nielsen Digital Content Rating or Digital TV Rating measurement in apps for dom-less platforms like ReactNative, NodeJS etc. apps.&lt;br /&gt;
&lt;br /&gt;
The Digital Content Ratings (DCR) Video product provides content consumption measurement on client mobile apps or webpages. This measurement includes insight into the total time a user spent watching the tracked content, video player events, and much more. This example provides the steps to implement the DCR Video product in a sample NodeJS app. It includes:&lt;br /&gt;
*DOM-less SDK Initialization&lt;br /&gt;
*DCR Video Metadata: information about the content being tracked&lt;br /&gt;
*DCR Video Events/API calls&lt;br /&gt;
By the end of this guide you will have the needed steps to integrate Nielsen's DOM-less SDK in your app.&lt;br /&gt;
===DOM-less SDK DCR Video Step 1 - Obtain AppID===&lt;br /&gt;
To begin using the DOM-less SDK you will need to obtain an Application ID (AppId)&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!&lt;br /&gt;
!Item&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
|-&lt;br /&gt;
|✅&lt;br /&gt;
|App ID (appid)&lt;br /&gt;
|Unique ID assigned to the player/site and configured by product&lt;br /&gt;
|Contact your Nielsen TAM&lt;br /&gt;
|}The appid is a 37 character unique ID assigned to the player/site and configured by product and is required when creating a new instance of the DOM-less SDK on the app.&lt;br /&gt;
&lt;br /&gt;
Example: '''PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX'''&lt;br /&gt;
===DOM-less SDK DCR Video Step 2 - SDK Initialization===&lt;br /&gt;
This project is an API that allows clients to integrate the Nielsen SDK in DOM-less environments like React Native, NodeJS, etc.&lt;br /&gt;
&lt;br /&gt;
Refer to the &amp;quot;[[Domless SDK API Reference#DOM-less SDK Initialization| DOM-less SDK initialization]] &amp;quot; section in the [[Domless SDK API Reference| DOM-less SDK API Reference Guide]].&lt;br /&gt;
====SDK Initialization====&lt;br /&gt;
The following table contains the list of arguments that can be passed&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!Parameter / Argument&lt;br /&gt;
!Description&lt;br /&gt;
!Source&lt;br /&gt;
!Required?&lt;br /&gt;
!Example&lt;br /&gt;
|-&lt;br /&gt;
|appid&lt;br /&gt;
|Unique Nielsen ID for the application. The ID is a GUID data type. If you did not receive your App ID, let us know and we will provide you.&lt;br /&gt;
|Nielsen-specified&lt;br /&gt;
|Yes&lt;br /&gt;
|PXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX&lt;br /&gt;
|-&lt;br /&gt;
|instanceName&lt;br /&gt;
|DOM-less SDK instance name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|String eg. abcdefg&lt;br /&gt;
|-&lt;br /&gt;
|appName&lt;br /&gt;
|Application name&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|appName: 'BSDK RN Sample App'&lt;br /&gt;
|-&lt;br /&gt;
|deviceId&lt;br /&gt;
|Device ID&lt;br /&gt;
|Client provided&lt;br /&gt;
|Yes&lt;br /&gt;
|deviceId: '38400000-8cf0-11bd-b23e-10b96e40000d'&lt;br /&gt;
|-&lt;br /&gt;
|nol_sdkDebug&lt;br /&gt;
|Enables Nielsen console logging. Only required for testing&lt;br /&gt;
|Client-provided&lt;br /&gt;
|No&lt;br /&gt;
|nol_sdkDebug: 'debug'&lt;br /&gt;
|-&lt;br /&gt;
|domlessEnv&lt;br /&gt;
|Specify the domless environment.&lt;br /&gt;
&amp;quot;1&amp;quot; for ReactNative &amp;quot;2&amp;quot; for Amazon &amp;quot;3&amp;quot; for NodeJS &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
|Client-provided&lt;br /&gt;
|Yes&lt;br /&gt;
|domlessEnv: '1'&lt;br /&gt;
|-&lt;br /&gt;
|nol_debugServerUrl&lt;br /&gt;
|This is the IP Address and port of where the debug-node-server host is running.&lt;br /&gt;
|Client-provided&lt;br /&gt;
|No&lt;br /&gt;
|'nol_debugServerUrl' : '&amp;lt;nowiki&amp;gt;http://0.0.0.0:3000'&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|nol_debugSessionTracking&lt;br /&gt;
|Value of &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot; which will either enable or disable the Session Manager in the SDK to send messages to the running debug node server. &lt;br /&gt;
|Client-provided&lt;br /&gt;
|No&lt;br /&gt;
|'nol_debugSessionTracking' : 'true'&lt;br /&gt;
|}&lt;br /&gt;
====Nielsen Debug Node Server====&lt;br /&gt;
The debug server is a Node.js server project that can be ran locally and will act as an api that uses web sockets to track messages and events that are fired from the Domless SDK when enabled in the initialization.&lt;br /&gt;
&lt;br /&gt;
[[Nielsen Debug Node Server|Nielsen Debug Node Server Repository]]&lt;br /&gt;
===DOM-less SDK DCR Video Step 3 - Create DCR Video Content Metadata Object===&lt;br /&gt;
====Events that can be passed to `ggPM` method====&lt;br /&gt;
1. &amp;lt;code&amp;gt;loadMetadata&amp;lt;/code&amp;gt; - This event is used to send DCR Video metadata to the Nielsen SDK. This event should be called when the video metadata is loaded.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    instance.ggPM('loadMetadata', {&lt;br /&gt;
&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;setPlayheadPosition&amp;lt;/code&amp;gt; - This event is used to send the current playhead position to the Nielsen SDK. This event should be called when the video is playing.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('setPlayheadPosition', 10);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt; - This event is used to send the end event to the Nielsen SDK. This event should be called when the video playback is finished, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('end', 300);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;4. &amp;lt;code&amp;gt;stop&amp;lt;/code&amp;gt; - This event is used to send the stop event to the Nielsen SDK. This event should be called when transitioning from ads to content and content to ads, passing the playhead at that time.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('stop', 120);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;5. &amp;lt;code&amp;gt;updateMetadata&amp;lt;/code&amp;gt; - This event allows updating metadata for the content or ad that is being played. This event cannot be used to update values for type, vidtype, or assetid parameters.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.ggPM('updateMetadata', {&lt;br /&gt;
       length: 90,&lt;br /&gt;
       segC: &amp;quot;My segC&amp;quot;&lt;br /&gt;
    });&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
======Events that can be passed to and processed by &amp;lt;code&amp;gt;processEvent&amp;lt;/code&amp;gt; method======&lt;br /&gt;
1. &amp;lt;code&amp;gt;`blur`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the background.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'blur', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2. &amp;lt;code&amp;gt;`focus`&amp;lt;/code&amp;gt; - This event should be passed to processEvent when the app goes to the foreground.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'focus', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;3. &amp;lt;code&amp;gt;`appclose`&amp;lt;/code&amp;gt; - This event should be passed prior to closing the app.&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    instance.processEvent({'type': 'appclose', 'timestamp': Date.now()});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===DOM-less SDK DCR Video Step 4 - Basic Set of Events - Sample Playback===&lt;br /&gt;
====Sample Nielsen BSDK-Domless NodeJS Example====&lt;br /&gt;
*[https://github.com/NielsenDigitalSDK/bsdk-domless-samples/tree/main/nodejs Nielsen bsdk-domless NodeJS Example]&lt;br /&gt;
====Sample DCR Video Integration====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
import { BsdkInstance } from 'bsdk-domless';&lt;br /&gt;
&lt;br /&gt;
const nsdkConfig = {&lt;br /&gt;
    app_id: 'PXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',&lt;br /&gt;
    instance_name: 'videoInstance',&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const implementationHooks = {&lt;br /&gt;
    Log: {&lt;br /&gt;
             info: function (log: string) {&lt;br /&gt;
         		        console.info(log);&lt;br /&gt;
		     },&lt;br /&gt;
		     debug: function (log: string) {&lt;br /&gt;
                        console.debug(log);&lt;br /&gt;
		     },&lt;br /&gt;
             warn: function (log: string) {&lt;br /&gt;
                        console.warn(log);&lt;br /&gt;
		     },&lt;br /&gt;
             error: function (error: string) {&lt;br /&gt;
                        console.error(error);&lt;br /&gt;
		     } &lt;br /&gt;
	     },&lt;br /&gt;
	Storage: {&lt;br /&gt;
		setItem: async function (key: any, value: string) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Sets a string value for given key. This operation can either modify an existing entry,&lt;br /&gt;
             * if it did exist for given key, or add new one otherwise.&lt;br /&gt;
             * In order to store object value, you need to serialize it, e.g. using JSON.stringify().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		getItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Gets a string value for given key. This function can either return a string value for &lt;br /&gt;
             * existing key or return null otherwise.&lt;br /&gt;
             * In order to store object value, you need to deserialize it, e.g. using JSON.parse().&lt;br /&gt;
            */&lt;br /&gt;
        },&lt;br /&gt;
		removeItem: async function (key: any) {&lt;br /&gt;
            /**&lt;br /&gt;
             * Removes item for a key, invokes (optional) callback once completed.&lt;br /&gt;
            */&lt;br /&gt;
        }&lt;br /&gt;
	  },&lt;br /&gt;
	Fetch: async function (url: string | URL | Request, options: any) {&lt;br /&gt;
        /**&lt;br /&gt;
        * We require that client pass in User-Agent header via options in Fetch request&lt;br /&gt;
        */&lt;br /&gt;
        const clientOpts = {&lt;br /&gt;
			headers: {&lt;br /&gt;
				&amp;quot;User-Agent&amp;quot;: &amp;quot;react-native-domless/1.6.7.42 Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X)&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
		const data = Object.assign(options, clientOpts);&lt;br /&gt;
		const response = await fetch(url, data);&lt;br /&gt;
		if (response.ok) {&lt;br /&gt;
			return response;&lt;br /&gt;
		} else {&lt;br /&gt;
			throw new Error('Request failed');&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
    SetTimeout: function (callback: () =&amp;gt; void, timeout: number | undefined) {&lt;br /&gt;
        return setTimeout(callback, timeout);	},&lt;br /&gt;
    SetInterval: function (callback: () =&amp;gt; void, interval: number | undefined) {&lt;br /&gt;
        return setInterval(callback, interval);&lt;br /&gt;
    },&lt;br /&gt;
    ClearTimeout: function (timeout: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearTimeout(timeout);&lt;br /&gt;
    },&lt;br /&gt;
    ClearInterval: function (interval: string | number | NodeJS.Timeout | undefined) {&lt;br /&gt;
        clearInterval(interval);&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const nSdkInstance = new BsdkInstance(&lt;br /&gt;
    nsdkConfig.app_id,&lt;br /&gt;
    nsdkConfig.instance_name,&lt;br /&gt;
    {&lt;br /&gt;
        appName: 'BSDK RN Sample App',&lt;br /&gt;
        deviceId: 'testDeviceId',&lt;br /&gt;
        nol_sdkDebug: 'debug', // remove debug flag when going to production&lt;br /&gt;
        domlessEnv: // &amp;quot;1&amp;quot; for React Native | &amp;quot;2&amp;quot; for Amazon | &amp;quot;3&amp;quot; for NodeJS | &amp;quot;4&amp;quot; for Custom&lt;br /&gt;
        // reference SDK interface documentation&lt;br /&gt;
        // for additonal metadata properties&lt;br /&gt;
    },&lt;br /&gt;
    implementationHooks );&lt;br /&gt;
&lt;br /&gt;
// Sample VideoPlayer component &lt;br /&gt;
const VideoPlayer = (props) =&amp;gt; {&lt;br /&gt;
/**&lt;br /&gt;
* Implementation of video player component will vary across the board, for Nielsen DOM-less SDK integration&lt;br /&gt;
* clients need only setup event listeners with corresponding ggPM() calls.&lt;br /&gt;
* &lt;br /&gt;
* Please refer to chosen video player documentation on available events&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
const video = useRef&amp;lt;Video&amp;gt;(null);&lt;br /&gt;
let previousPlayhead = 0; // keep track of previous playhead position&lt;br /&gt;
let metadataLoaded = false; // in case of replay scenario set flag for metadata load&lt;br /&gt;
&lt;br /&gt;
// Sample video metadata&lt;br /&gt;
const videometadata = {&lt;br /&gt;
        'type': 'content',&lt;br /&gt;
        'assetid': 'VID-123456',&lt;br /&gt;
        'program': 'program name',&lt;br /&gt;
        'title': 'episode title with season and episode number',&lt;br /&gt;
        'length': 'length in seconds',&lt;br /&gt;
        'airdate': '20210321 09:00:00',&lt;br /&gt;
        'isfullepisode': 'y',&lt;br /&gt;
        'adloadtype': '2',&lt;br /&gt;
        'segB': 'custom segment B', // optional&lt;br /&gt;
        'segC': 'custom segment C', // optional&lt;br /&gt;
        'crossId1': 'Standard Episode ID', // optional&lt;br /&gt;
        'crossId2': 'Content Originator' //optional&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
const setUpEventListeners = (): void =&amp;gt; {&lt;br /&gt;
     video.addEventListener('ended', onEnded);&lt;br /&gt;
     video.addEventListener('timeupdate', onTimeUpdate);&lt;br /&gt;
     video.addEventListener('playing', onPlay);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onEnded = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'end' event&lt;br /&gt;
    if (nSdkInstance) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('end', Math.round(video.currentTime));&lt;br /&gt;
            metadataLoaded = false;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
const onTimeUpdate = () =&amp;gt; {&lt;br /&gt;
    const currPlayhead = Math.round(video.current?.currentTime!);&lt;br /&gt;
    if (currPlayhead &amp;gt; 0 &amp;amp;&amp;amp; currPlayhead !== previousPlayhead) {&lt;br /&gt;
        previousPlayhead = currPlayhead;&lt;br /&gt;
        // Nielsen SDK ggPM 'setPlayheadPosition' event&lt;br /&gt;
        if (nSdkInstance) {&lt;br /&gt;
            nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
                instance.ggPM('setPlayheadPosition', currPlayhead);&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// NOTE: some players may have an event when video metadata is loaded, recommended to use if available. E.g. loadedmetadata&lt;br /&gt;
const onPlay = () =&amp;gt; {&lt;br /&gt;
    // Nielsen SDK ggPM 'loadmetadata' event&lt;br /&gt;
    if (nSdkInstance &amp;amp;&amp;amp; !metadataLoaded) {&lt;br /&gt;
        nSdkInstance.then((instance: any) =&amp;gt; {&lt;br /&gt;
            instance.ggPM('loadMetadata', videometadata);&lt;br /&gt;
            metadataLoaded = true;&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
return (&lt;br /&gt;
       &amp;lt;View&amp;gt;&lt;br /&gt;
          &amp;lt;Video&lt;br /&gt;
                 source={{ uri: 'https://www.w3schools.com/html/mov_bbb.mp4' }}&lt;br /&gt;
             /&amp;gt;&lt;br /&gt;
      &amp;lt;/View&amp;gt;&lt;br /&gt;
  );&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>DanielKrotov</name></author>
	</entry>
</feed>