<commit_before># IMA SDK Plugin for Video.js

[![Build Status](https://travis-ci.org/googleads/videojs-ima.svg?branch=master)](https://travis-ci.org/googleads/videojs-ima) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=<KEY>--b8066916a46dd2f255b416f80f40ca7c3518ad46)](https://www.browserstack.com/automate/public-build/N1g3U09HWEhZR09OSVc2YmhiWFlGaExMQmswMmo0Z1F3NVRjT0VvZCtWST0tLUo0QUdnZ1gyMmhJUHZsRGJ3dTBpWWc9PQ==--b8066916a46dd2f255b416f80f40ca7c3518ad46)

## Introduction
The IMA SDK Plugin for Video.js provides a quick and easy IMA SDK integration
for the Video.js player.

To see the plugin in action, check out our
[samples](//googleads.github.io/videojs-ima/).

## Features
- Easily integrate the Google IMA SDK into Video.js to enable advertising on
your video content.

## Requirements
  - Your favorite text editor
  - 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 moduel),
a video player to be used for playback, and a script tag for the ima3.js file and your own
javascript file.

```html
<html>
  <head>
    <!-- Load dependent stylesheets. -->
    <link href="path/to/video-js.css" rel="stylesheet">
  </head>

  <body>
    <video id='content-player' class="video-js">
        <p class='vjs-no-js'>
            To view this video please enable JavaScript, and consider upgrading to a web browser that
            <a href='https://videojs.com/html5-video-support/' target='_blank'>supports HTML5 video</a>
        </p>
    </video>
    <!-- Load dependent scripts -->
    <script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
    <script src="player.js"></script>
  </body>
</html>
```

Three imports are required to use the video.js ima moduel, then the standard implementation
of video.js with the ima player can be used. See the player.js exmaple 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 imaOptions = {
  adTagUrl: 'https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=vmap&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ar%3Dpreonly&cmsid=496&vid=short_onecue&correlator='
};

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).<commit_msg>fix: fixed small errors in Readme update<commit_after># IMA SDK Plugin for Video.js

[![Build Status](https://travis-ci.org/googleads/videojs-ima.svg?branch=master)](https://travis-ci.org/googleads/videojs-ima) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=<KEY>--b8066916a46dd2f255b416f80f40ca7c3518ad46)](https://www.browserstack.com/automate/public-build/N1g3U09HWEhZR09OSVc2YmhiWFlGaExMQmswMmo0Z1F3NVRjT0VvZCtWST0tLUo0QUdnZ1gyM<KEY>PQ==--b8066916a46dd2f255b416f80f40ca7c3518ad46)

## Introduction
The IMA SDK Plugin for Video.js provides a quick and easy IMA SDK integration
for the Video.js player.

To see the plugin in action, check out our
[samples](//googleads.github.io/videojs-ima/).

## Features
- Easily integrate the Google IMA SDK into Video.js to enable advertising on
your video content.

## Requirements
  - Your favorite text editor
  - 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 moduel),
a video player to be used for playback, and a script tag for the ima3.js file and your own
javascript file.

```html
<html>
  <head>
    <!-- Load dependent stylesheets. -->
    <link href="path/to/video-js.css" rel="stylesheet">
  </head>

  <body>
    <video id='content-player' class="video-js">
        <p class='vjs-no-js'>
            To view this video please enable JavaScript, and consider upgrading to a web browser that
            <a href='https://videojs.com/html5-video-support/' target='_blank'>supports HTML5 video</a>
        </p>
    </video>
    <!-- Load dependent scripts -->
    <script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
    <script src="player.js"></script>
  </body>
</html>
```

Three imports are required to use the videojs-ima moduel, then the standard implementation
of video.js with the ima player can be used. See the player.js exmaple 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).
{'fraction_non_alphanumeric': 0.11830322073841319, 'fraction_numerical': 0.02812254516889238, 'mean_word_length': 4.200980392156863, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 44, 'https://': 11, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3883699', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2094, 'n_words': 626}