Skip to content

Commit

Permalink
feat(ads): Add getDescription to CS and SS ads (shaka-project#4526)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Sep 29, 2022
1 parent c97768b commit 7d2a170
Show file tree
Hide file tree
Showing 5 changed files with 38 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 @@ -170,6 +170,9 @@ google.ima.Ad = class {

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

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


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

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

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


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

/**
* @return {string}
*/
getDescription() {}
};
8 changes: 8 additions & 0 deletions lib/ads/client_side_ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,14 @@ shaka.ads.ClientSideAd = class {
return this.ad_.getTitle();
}

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

/**
* @override
* @export
Expand Down
8 changes: 8 additions & 0 deletions lib/ads/server_side_ad.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ shaka.ads.ServerSideAd = class {
return this.ad_.getTitle();
}

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

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

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

/** @private {string} */
this.description_ = 'Test Description';
}

/**
Expand Down Expand Up @@ -201,6 +204,14 @@ shaka.test.FakeAd = class {
return this.title_;
}

/**
* @override
* @export
*/
getDescription() {
return this.description_;
}

/**
* @override
* @export
Expand Down

0 comments on commit 7d2a170

Please sign in to comment.