Skip to content

Commit

Permalink
feat: Multilingual UI support for the adLabel "N of N" string (#592)
Browse files Browse the repository at this point in the history
* Multilingual UI support for the adLabel "N of N" string

* Multilingual UI support for the adLabel "N of N" string - correct line max length

* Multilingual UI support for the adLabel "N of N" string - correct indentation
  • Loading branch information
anvalchev authored and shawnbuso committed Apr 18, 2018
1 parent dba1a51 commit 4cba6d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -89,6 +89,7 @@ the previous snippet. A summary of all settings follows:
| adTagUrl | string | REQUIRED IF adsResponse IS NOT PROVIDED A URL which returns a VAST, VMAP or ad rules,response. |
| adsResponse | string | REQUIRED IF adTagUrl IS NOT PROVIDED The VAST, VMAP, or ad rules response to use,in lieu of fetching one an ad tag. |
| adLabel | string | Replaces the "Advertisement" text in the ad label. Added for multilingual UI support. |
| adLabelNofN | string | Replaces the "of" text in the ad label (e.g. ... (1 of 2) ...). Added for multilingual UI support. |
| adsRenderingSettings | object | JSON object with ads rendering settings as defined in the IMA SDK,Docs(1). |
| autoPlayAdBreaks | boolean | Whether or not to automatically play VMAP or ad rules ad breaks. Defaults,to true. |
| **deprecated** adWillPlayMuted | boolean | Notifies the SDK whether the player intends to start ad while muted. Changing this setting will have no impact on ad playback. Defaults,to false. |
Expand Down
3 changes: 2 additions & 1 deletion src/ad-ui.js
Expand Up @@ -268,7 +268,8 @@ AdUi.prototype.updateAdUi =
}
let podCount = ': ';
if (totalAds > 1) {
podCount = ' (' + adPosition + ' of ' + totalAds + '): ';
podCount = ' (' + adPosition + ' ' +
this.controller.getSettings().adLabelNofN + ' ' + totalAds + '): ';
}
this.countdownDiv.innerHTML =
this.controller.getSettings().adLabel + podCount +
Expand Down
1 change: 1 addition & 0 deletions src/controller.js
Expand Up @@ -78,6 +78,7 @@ Controller.IMA_DEFAULTS = {
timeout: 5000,
prerollTimeout: 1000,
adLabel: 'Advertisement',
adLabelNofN: 'of',
showControlsForJSAds: true,
};

Expand Down

0 comments on commit 4cba6d4

Please sign in to comment.