# Ads setup

  • Include Google IMA SDK script in case of ads usage. - required if you want to IMA use ads
<script type="text/javascript" src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
  • Schedule ads

    *Next time when player will reach the provided timeOffset - relevant ad will be played.

// player.setSrc({{ sourceUrl }});
player.ads.scheduleAds([
    { source: "{{ preRollAdUrl }}", timeOffset: "start" },
    { source: "{{ midroll ad url to be played at second 5 }}", timeOffset: 5 },
    { source: "{{ midroll ad url to be played at second 10 }}", timeOffset: 10 },
]);

Note

Currently only VAST ads are supported.

So please make sure you're using them when providing the source.

IMA Examples

You might find useful some examples of IMA Ad Tags for testing purposes:

Examples: https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags (opens new window)

Last Updated: 4/3/2023, 12:48:25 PM