age-watermark v0.3.0
This is npm module used to encapsulate business logic regarding legal obligations for age watermark, which must be present in the Rail, EPG, Event, Search and Playback. Backend servcies provides AgeRestrictionImage
attribute with URL pointing proper watermark picture. Watermark should be only visible when asset is marked with VerifyAge
or PinProtect
attributes.
Find more: LLD for age watermarks
Usage
To install package simple execute:
npm -i @dazn/age-watermark -save
Playback
To decorate asset to match legal obligation for playback add decorator function:
import { decoratePlaybackWithAgeWatermark } from '@dazn/age-watermark';
Then in the processing part:
decoratePlaybackWithAgeWatermark(asset, contentCountry);
Where contentCountry
is country from JWT, but verified using geofencing and portability rules. And asset definition is main article definition:
{
"ViewerPPID": "f6f53daf7c7b27812e21b06ffa81b26e2d72234ff7da8283ac6707e810bcfbfd",
"AnalyticsSessionId": "13626485548103813070",
"Asset": { <-- Asset example
"Id": "16sjxlztmhho11223c22dvsegh",
"Title": "NFL Network",
...
}
Catalog services
To decorate catalog items to match legal obligations add decorator function:
import { decorateCatalogWithAgeWatermark } from '@dazn/age-watermark';
Then in the processing part:
decorateCatalogWithAgeWatermark(item, contentCountry);
Where contentCountry
is country provided within client request and item is single event item, which may contain VerifyAge
or PinProtect
attributes.
Build and publish
To run TypeScript build on your own, simply run:
npm install
npm run build
To publish simply merge changes into master
branch and run drone deploy on release env.
3 years ago