Skip to content

Commit

Permalink
feat: Allow for an adsRequest object to be passed to the plugin. This… (
Browse files Browse the repository at this point in the history
#656)

* feat: Allow for an adsRequest object to be passed to the plugin. This allows us to support additional adRequest properties. Fixes #653.

* Updated to accept adsRequest everywhere we accept adTagUrl or adResponse.

* Fix missing null check.

* Fix typo

* Added setContentWithAdsRequest to ima-plugin.

* Fix bad copypasta.

* Fix lint error.
  • Loading branch information
shawnbuso authored Jun 13, 2018
1 parent 02b9852 commit 80aba35
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 1,565 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,36 +86,39 @@ the previous snippet. A summary of all settings follows:
| Settings | Type | Description |
|----------|------|-------------|
| id | string | REQUIRED The id of your video player |
| 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. |
| adTagUrl | string | A URL which returns a VAST, VMAP or ad rules,response. This will override adsResponse. |
| adsResponse | string | The VAST, VMAP, or ad rules response to use,in lieu of fetching one an ad tag. This is overridden if adTagUrl is set. |
| adsRequest | object | JSON object with ads request properties defined in the IMA SDK Docs(2). Properties set here that can also be provided elsewhere (e.g. adTagUrl) will override those other settings. |
| 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). |
| 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. |
| contribAdsSettings | object | Additional settings to be passed to the contrib-ads plugin(2), used by,this IMA plugin. |
| contribAdsSettings | object | Additional settings to be passed to the contrib-ads plugin(3), used by,this IMA plugin. |
| debug | boolean | True to load the debug version of the plugin, false to load the non-debug version.,Defaults to false. |
| disableFlashAds | boolean | True to disable Flash ads - Flash ads will be considered an unsupported ad type. Defaults to false. |
| disableCustomPlaybackForIOS10Plus | boolean | Sets whether to disable custom playback on iOS 10+ browsers. If true, ads will play inline if the content video is inline. Defaults to false. |
| forceNonLinearFullSlot | boolean | True to force non-linear AdSense ads to render as linear fullslot.,If set, the content video will be paused and the non-linear text or image ad will be rendered as,fullslot. The content video will resume once the ad has been skipped or closed. |
| locale | string | Locale for ad localization. This may be any,ISO 639-1 (two-letter) or ISO 639-2,(three-letter) code(3). Defaults to 'en'. |
| locale | string | Locale for ad localization. This may be any,ISO 639-1 (two-letter) or ISO 639-2,(three-letter) code(4). Defaults to 'en'. |
| 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. |
| numRedirects | number | Maximum number of VAST redirects before the subsequent redirects will be denied,,and the ad load aborted. The number of redirects directly affects latency and thus user experience.,This applies to all VAST wrapper ads. |
| showControlsForJSAds | boolean | Whether or not to show the control bar for VPAID JavaScript ads. Defaults to true. |
| showCountdown | boolean | Whether or not to show the ad countdown timer. Defaults to true. |
| vastLoadTimeout | number | Override for default VAST load timeout in milliseconds for a single wrapper. The default timeout is 5000ms. |
| vpaidAllowed | boolean | (DEPRECATED, please use vpaidMode). |
| vpaidMode | VpaidMode(4) | VPAID Mode. Defaults to ENABLED. This setting,overrides vpaidAllowed. |
| vpaidMode | VpaidMode(5) | 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)
(2) [IMA SDK Docs](//developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdsRequest)
<br />
(3) [Valid locale codes](http://www.loc.gov/standards/iso639-2/php/English_list.php)
(3) [contrib-ads plugin](//github.com/videojs/videojs-contrib-ads)
<br />
(4) [google.ima.ImaSdkSettings.VpaidMode](//developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.ImaSdkSettings.VpaidMode)
(4) [Valid locale codes](http://www.loc.gov/standards/iso639-2/php/English_list.php)
<br />
(5) [google.ima.ImaSdkSettings.VpaidMode](//developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.ImaSdkSettings.VpaidMode)

## Disable automatic ad break playback
In some circumstances you may want to prevent the SDK from playing ad breaks
Expand Down
Loading

0 comments on commit 80aba35

Please sign in to comment.