Using IMA Ads with AMP

Implementation of IMA ads into AMP. The plugin can be implemented by providing a ima object in the player config:

var config = {
  plugins: {
    ima: {
      resources: [
        {src: "//imasdk.googleapis.com/js/sdkloader/ima3.js", debug: "//imasdk.googleapis.com/js/sdkloader/ima3_debug.js", type: "text/javascript", async: true},
        {src: "${paths.plugins}ima/Ima.min.js", debug: "${paths.plugins}ima/Ima.js", type: "text/javascript", async: true}
      ],
      adTagUrl: {
        params: {
          sz: "640x480",
          iu: "/124319096/external/ad_rule_samples",
          ciu_szs: "300x250",
          ad_rule: 1,
          impl: "s",
          gdfp_req: 1,
          env: "vp",
          output: "xml_vmap1",
          unviewed_position_start: 1,
          cust_params: {
            sample_ar: "premidpostpod"
          },
          cmsid: 496,
          vid: "short_onecue",
          correlator: "#{now}"
        }
      },
      disableCompanionAds: false,
      ppid: "ABCDE123456789012345678901234567",
      vpaidMode: "enabled",
      disableFlashAds: true,
      companions: [
        {
          id: "companion-container",
          width: 300,
          height: 250
        }
      ]
    }
  }
};
akamai.amp.AMP.create("amp", config);