Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/missing c4 parameter #50

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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