Skip to content

Commit

Permalink
Added vpaidMode to options.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury Pavlotsky committed Sep 4, 2015
1 parent 85ad3a9 commit 10e9dfc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,17 @@ The plugin accepts additional settings beyond the two required settings shown in
nonLinearWidth: <Number> Desired width of non-linear ads. Defaults to player width.
nonLinearHeight: <Number> Desired height for non-linear ads. Defaults to 1/3 player height.
showCountdown: <boolean> Whether or not to show the ad countdown timer. Defaults to true.
vpaidAllowed: <boolean> Whether or not to allow VPAID ads. Defaults to true.
vpaidAllowed: <boolean> (DEPRECATED, please use vpaidMode).
vpaidMode: <google.ima.ImaSdkSettings.VpaidMode(4)> VPAID Mode. Defaults to ENABLED. This setting overrides vpaidAllowed.
}
```
(1) [IMA SDK Docs](//developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdsRenderingSettings)
<br />
(2) [contrib-ads plugin](//github.com/videojs/videojs-contrib-ads)
<br />
(3) [Valid locale codes](http://www.loc.gov/standards/iso639-2/php/English_list.php)
<br />
(4) [google.ima.ImaSdkSettings.VpaidMode](//developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.ImaSdkSettings.VpaidMode)

##Where do I report issues?
Please report issues on the [issues page](../../issues).
Expand Down
9 changes: 7 additions & 2 deletions src/videojs.ima.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,14 @@

adsLoader = new google.ima.AdsLoader(adDisplayContainer);

adsLoader.getSettings().setVpaidAllowed(true);
adsLoader.getSettings().setVpaidMode(
google.ima.ImaSdkSettings.VpaidMode.ENABLED);
if (settings.vpaidAllowed == false) {
adsLoader.getSettings().setVpaidAllowed(false);
adsLoader.getSettings().setVpaidMode(
google.ima.ImaSdkSettings.VpaidMode.DISABLED);
}
if (settings.vpaidMode) {
adsLoader.getSettings().setVpaidMode(settings.vpaidMode);
}

if (settings.locale) {
Expand Down

0 comments on commit 10e9dfc

Please sign in to comment.