Skip to content

Commit

Permalink
feat(ads): Add getTitle to CS and SS ads (shaka-project#4513)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Sep 26, 2022
1 parent 7166f0c commit a019065
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
6 changes: 6 additions & 0 deletions externs/ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ google.ima.Ad = class {

/** @return {boolean} */
isLinear() {}

/** @return {string} */
getTitle() {}
};


Expand Down Expand Up @@ -389,6 +392,9 @@ google.ima.dai.api.Ad = class {

/** @return {boolean} */
isSkippable() {}

/** @return {string} */
getTitle() {}
};


Expand Down
5 changes: 5 additions & 0 deletions externs/shaka/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,9 @@ shaka.extern.IAd = class {
* @return {number}
*/
getPositionInSequence() {}

/**
* @return {string}
*/
getTitle() {}
};
7 changes: 7 additions & 0 deletions lib/ads/client_side_ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@ shaka.ads.ClientSideAd = class {
return podInfo.getAdPosition();
}

/**
* @override
* @export
*/
getTitle() {
return this.ad_.getTitle();
}

/**
* @override
Expand Down
7 changes: 7 additions & 0 deletions lib/ads/server_side_ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ shaka.ads.ServerSideAd = class {
return podInfo.getAdPosition();
}

/**
* @override
* @export
*/
getTitle() {
return this.ad_.getTitle();
}

/**
* @override
Expand Down
10 changes: 10 additions & 0 deletions test/test/util/fake_ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ shaka.test.FakeAd = class {

/** @private {number} */
this.volume_ = 1;

/** @private {string} */
this.title_ = 'Test Title';
}

/**
Expand Down Expand Up @@ -190,6 +193,13 @@ shaka.test.FakeAd = class {
return this.position_;
}

/**
* @override
* @export
*/
getTitle() {
return this.title_;
}

/**
* @override
Expand Down

0 comments on commit a019065

Please sign in to comment.