Skip to content

Instantly share code, notes, and snippets.

@GiriAakula
Last active April 2, 2021 14:00
Show Gist options
  • Save GiriAakula/ef4801ce73931a7e0a22e10fd96b4260 to your computer and use it in GitHub Desktop.
Save GiriAakula/ef4801ce73931a7e0a22e10fd96b4260 to your computer and use it in GitHub Desktop.
Vidgyor Midroll Integrations Docs

Vidgyor Midroll Plugin Docs

To integrate the midroll plugin to your existing videojs player follow the below steps.

Add CSS

<link rel="stylesheet" href="https://vgrplayer.s3.ap-south-1.amazonaws.com/midroll-test-player/vidgyor-vjs_v3.css">

Add Javascript

<script src="https://vgrplayer.s3.ap-south-1.amazonaws.com/midroll-player/ads.min.js"></script>

<script src="https://vgrplayer.s3.ap-south-1.amazonaws.com/midroll-player/midroll.min.js"></script>

Add config and initialize the plugin

var myconf = {
  'adsm': 'ext',
  'ads': {
    "mobile": {
      "url": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=[timestamp]"
    },
    "desktop": {
      "url": "https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/single_ad_samples&ciu_szs=300x250&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&cust_params=deployment%3Ddevsite%26sample_ct%3Dskippablelinear&correlator=[timestamp]"
    }
  },
  "channelid":"mktest",
  "midrollErrorFallback":false,
  "timeForNextMidroll":5,
  "pollerStartDelaySecs":5,
  "midrolltimer":true,
  "midrolltimerSeconds":5,
  "midrolltimerMessage":"Ad start soon",
  "midrollErrorFallbackBannerSlot":"/106213651/Test_Display_300x250",
};
player.midrollPlugin(myconf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment