Skip to content

Commit

Permalink
Merge pull request #50 from THEOplayer/bugfix/missing-c4-parameter
Browse files Browse the repository at this point in the history
Bugfix/missing c4 parameter
  • Loading branch information
wjoosen authored Sep 23, 2024
2 parents 2d4bf8f + de8e276 commit b35d783
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-turkeys-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@theoplayer/nielsen-connector-web": minor
---

Added an optional c4 parameter to `NielsenDCRContentMetadataCZ`.
12 changes: 12 additions & 0 deletions nielsen/src/nielsen/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ export type NielsenDCRContentMetadataCZ = NielsenDCRContentMetadata & {
* [LIVE] Keep empty : "nol_c2":"p2,"
*/
c2?: string;
/*
* The actual duration of the live broadcast
* [VOD] Keep empty
* [LIVE] Pass the duration of the live broadcast in seconds
*/
c4?: string;
/*
* CMS tag helper item. Indication of whether the content being played supports the insertion of advertisements. “0” – No ads “1” – Supports ads “2” – Don't know (default).
*/
Expand Down Expand Up @@ -162,6 +168,12 @@ export type DCRContentMetadataCZ = DCRContentMetadata & {
* [LIVE] Keep empty : "nol_c2":"p2,"
*/
nol_c2?: string;
/*
* The actual duration of the live broadcast
* [VOD] Keep empty
* [LIVE] Pass the value in seconds as follows "nol_c4" : "p4,value_in_seconds"
*/
nol_c4?: string;
/*
* CMS tag helper item. Indication of whether the content being played supports the insertion of advertisements. “0” – No ads “1” – Supports ads “2” – Don't know (default).
*/
Expand Down
5 changes: 3 additions & 2 deletions nielsen/src/utils/Util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ export function buildDCRContentMetadata(
adloadtype: metadata.adloadtype
};
if (country === NielsenCountry.CZ) {
const { crossId1, segB, segC, c1, c2, hasAds } = metadata as NielsenDCRContentMetadataCZ;
const { crossId1, segB, segC, c1, c2, c4, hasAds } = metadata as NielsenDCRContentMetadataCZ;
const dcrContentMetadataCZ: DCRContentMetadataCZ = {
...dcrContentMetadata,
['crossId1']: crossId1,
['nol_c1']: `p1,${c1 ?? ''}`,
['nol_c2']: `p2,${c2 ?? ''}`,
['nol_c4']: `p4,${c4 ?? ''}`,
segB: segB,
segC: segC ?? '',
hasAds: hasAds
};
if (c1) dcrContentMetadataCZ['nol_c1'] = `p1,${c1}`;
return dcrContentMetadataCZ;
}
if (country === NielsenCountry.US) {
Expand Down

0 comments on commit b35d783

Please sign in to comment.