diff --git a/.gitignore b/.gitignore index b9470778..c2658d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ node_modules/ -dist/ diff --git a/.travis.yml b/.travis.yml index bf4d2da0..0866251b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,18 +3,18 @@ node_js: - node dist: trusty sudo: required -env: - matrix: - - MOZ_HEADLESS=1 - global: - secure: byXkN+FuQNpI15xX5TUjFHoZCpEPI4o8Ophb1OvaE10dwlN0tnS7rsFkWJD6u3Ipx7y5VmpTkvxYOtvWYVt3ZbpP8sJTB+bOSsp2zrgX5vByEvZ7z3W2mkDYW1nuwM9zBtv9lkhdKlNCjNNsvw4izoFhOZXoWWsPjMEkanWzkq0= +#env: +# matrix: +# - MOZ_HEADLESS=1 +# global: +# secure: byXkN+FuQNpI15xX5TUjFHoZCpEPI4o8Ophb1OvaE10dwlN0tnS7rsFkWJD6u3Ipx7y5VmpTkvxYOtvWYVt3ZbpP8sJTB+bOSsp2zrgX5vByEvZ7z3W2mkDYW1nuwM9zBtv9lkhdKlNCjNNsvw4izoFhOZXoWWsPjMEkanWzkq0= addons: chrome: stable - firefox: latest - browserstack: - username: adsdevrel1 - access_key: - secure: CD76OVHjif8tBfkULJASD84oFh0bAoYpZJkRIy6f5+gi46iPS7GA/t2++Fatuxi11XZ6EDH3y0eFrGeXau0/3Ut6Et2br2TWzwpt/TSbfpjkGGXKy6IJb0Jbsy/HMEJrmr8krkF9rALND1geJMgy2RVF9u3ri21JQqA2uMCOpYs= +# firefox: latest +# browserstack: +# username: adsdevrel1 +# access_key: +# secure: CD76OVHjif8tBfkULJASD84oFh0bAoYpZJkRIy6f5+gi46iPS7GA/t2++Fatuxi11XZ6EDH3y0eFrGeXau0/3Ut6Et2br2TWzwpt/TSbfpjkGGXKy6IJb0Jbsy/HMEJrmr8krkF9rALND1geJMgy2RVF9u3ri21JQqA2uMCOpYs= script: - npm run lint - npm test diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cfdc600..f53838cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,23 @@ + +## [1.6.3](https://github.com/googleads/videojs-ima/compare/v1.6.2...v1.6.3) (2019-09-30) + + +## [1.6.2](https://github.com/googleads/videojs-ima/compare/v1.6.0...v1.6.2) (2019-09-11) + +### Bug Fixes + +* changed to parseFloat ([2b854a4](https://github.com/googleads/videojs-ima/commit/2b854a4)) +* fixed error in videojs.ima.min.js ([3d4e995](https://github.com/googleads/videojs-ima/commit/3d4e995)) +* fixed small errors in Readme update ([18186f9](https://github.com/googleads/videojs-ima/commit/18186f9)) +* removed second param from parseFloat ([4b5eef9](https://github.com/googleads/videojs-ima/commit/4b5eef9)) + # [1.6.0](https://github.com/googleads/videojs-ima/compare/v1.5.2...v1.6.0) (2019-06-26) +### Features + +* adds a request mode for ad requests ([278556b](https://github.com/googleads/videojs-ima/commit/278556b)) + ### Bug Fixes * fix via npm audit, take two ([#771](https://github.com/googleads/videojs-ima/issues/771)) ([e0d59f5](https://github.com/googleads/videojs-ima/commit/e0d59f5)) diff --git a/README.md b/README.md index af35112d..5d89453f 100644 --- a/README.md +++ b/README.md @@ -18,12 +18,69 @@ your video content. - A JavaScript enabled browser ## Getting started + +### ES6 Imports The easiest way to get started is by using [npm](//www.npmjs.org/). ``` npm install videojs-ima ``` +Your index.html should contain the video.js stylesheet (not included in the npm module), +a video player to be used for playback, and script tags for the IMA SDK and your own +javascript file. + +```html + +
+ + + + + + + + + + + +``` + +Three imports are required to use the videojs-ima module, as seen in the player.js example below. + +```javascript +import videojs from 'video.js'; +import 'videojs-contrib-ads'; +import 'videojs-ima'; + +var videoOptions = { + controls: true, + sources: [{ + src: 'PATH_TO_YOUR_CONTENT_VIDEO', + type: 'YOUR_CONTENT_VIDEO_TYPE', + }] +}; + +var player = videojs('content_video', videoOptions); + +var imaOptions = { + adTagUrl: 'YOUR_AD_TAG' +}; + +player.ima(imaOptions); +// On mobile devices, you must call initializeAdDisplayContainer as the result +// of a user action (e.g. button click). If you do not make this call, the SDK +// will make it for you, but not as the result of a user action. For more info +// see our examples, all of which are set up to work on mobile devices. +// player.ima.initializeAdDisplayContainer(); +``` + +### Alternative Setup If you don't use npm, you can download the source from the dist/ folder and include it directly in your project. You'll also need to download the source for the [videojs-contrib-ads plugin](//github.com/videojs/videojs-contrib-ads). @@ -98,7 +155,7 @@ the previous snippet. A summary of all settings follows: | 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. | | id | string | **DEPRECATED** as of v.1.5.0, no longer used or required. | -| 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'. | +| locale | string | Locale for ad localization. The supported locale codes can be found in [Localizing for Language and Locale](//developers.google.com/interactive-media-ads/docs/sdks/html5/localization)| | 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. | @@ -115,7 +172,7 @@ the previous snippet. A summary of all settings follows: