Skip to content

Commit

Permalink
feat(FEC-10970): expose vpaid field on ad object (#410)
Browse files Browse the repository at this point in the history
expose vpaid on Ad object

Depends on 
kaltura/playkit-js#540

Solves FEC-10970
  • Loading branch information
yairans authored Feb 7, 2021
1 parent 2442b1a commit 2db9ce8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@playkit-js/playkit-js": "0.68.0-canary.c6b4a44",
"@playkit-js/playkit-js": "0.68.0-canary.791b3c4",
"@playkit-js/playkit-js-dash": "1.21.2",
"@playkit-js/playkit-js-hls": "1.23.0",
"@playkit-js/playkit-js-ui": "0.63.0",
Expand Down
14 changes: 13 additions & 1 deletion src/common/ads/ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Ad {
_bitrate: number;
_bumper: boolean;
_inStream: boolean;
_vpaid: boolean;

constructor(id: string, options: PKAdOptions) {
this._id = id;
Expand All @@ -40,6 +41,7 @@ class Ad {
this._bitrate = options.bitrate || 0;
this._bumper = options.bumper;
this._inStream = options.inStream || false;
this._vpaid = options.vpaid || false;
}

/**
Expand Down Expand Up @@ -195,6 +197,15 @@ class Ad {
return !!(this.skipOffset && this.skipOffset > 0);
}

/**
* @instance
* @memberof Ad
* @return {boolean} - Whether the ad is vpaid or not.
*/
get vpaid(): boolean {
return this._vpaid;
}

toJSON(): Object {
return {
id: this.id,
Expand All @@ -213,7 +224,8 @@ class Ad {
height: this.height,
bitrate: this.bitrate,
bumper: this.bumper,
inStream: this.inStream
inStream: this.inStream,
vpaid: this.vpaid
};
}
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1150,10 +1150,10 @@
react-redux "^7.2.0"
redux "^4.0.5"

"@playkit-js/playkit-js@0.68.0-canary.c6b4a44":
version "0.68.0-canary.c6b4a44"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.68.0-canary.c6b4a44.tgz#51e2e49bdb385eeaadcd4112ba9e36096c3f5e08"
integrity sha512-gD78eq/AXdXgH4rmOyk49SJGJRwMAJUGQWDFDc88vVw45y/KieNp0CSSjHZFZk9oLZx+Ut+2ZnNhkhEVD50vnA==
"@playkit-js/playkit-js@0.68.0-canary.791b3c4":
version "0.68.0-canary.791b3c4"
resolved "https://registry.yarnpkg.com/@playkit-js/playkit-js/-/playkit-js-0.68.0-canary.791b3c4.tgz#103510688e01eed666398b6ef9e30772d30f0239"
integrity sha512-ISwkEnOFnUTDvVjYpNy3V3jW7j8Em10du5+pJ0MgeXE/6FL9/QPwugX0LUZ2pZTGK4ZmozrLKifeWWGsBgNmkw==
dependencies:
js-logger "^1.6.0"
ua-parser-js "^0.7.21"
Expand Down

0 comments on commit 2db9ce8

Please sign in to comment.