Documentation

Radiant Media Player

Ad scheduler

Features summary

  • Insert pre-roll, mid-roll and/or post-roll ads at designated timestamps
  • Compatible with on-demand and live media content for desktop and mobile devices
  • Works with Google IMA SDK and rmp-vast
  • Use client side waterfalling to maximize fill-rate
  • Does not require VMAP support

1 pre-roll, 2 mid-roll at 30s and 60s, 1 post-roll video ads

<script src="https://cdn.radiantmediatechs.com/rmp/6.4.10/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  // Streaming source - MP4 progressive download in this example
  var src = {
    mp4: [
      'https://your-mp4-url.mp4'
    ]
  };
  // Define ad-schedule
  var schedule = {
    // Preroll
    preroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // Midroll
    midroll: [
      [30, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml'],
      [60, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml']
    ],
    // Postroll
    postroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'
  };
  var settings = {
    licenseKey: 'your-license-key',
    width: 640,
    height: 360,
    src: src,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    ads: true,
    // Pass ad schedule
    adSchedule: schedule
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  rmp.init(settings);
</script>

Using percent to add mid-roll ads

<script src="https://cdn.radiantmediatechs.com/rmp/6.4.10/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  // Streaming source - HLS in this example
  var src = {
    hls: 'https://your-hls-url.m3u8'
  };
  // Define ad-schedule
  var schedule = {
    // Preroll
    preroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // Midroll
    midroll: [
      ['5%', 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml'],
      ['50%', 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml']
    ],
    // Postroll
    postroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'
  };
  var settings = {
    licenseKey: 'your-license-key',
    width: 640,
    height: 360,
    src: src,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    ads: true,
    // Pass ad schedule
    adSchedule: schedule
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  rmp.init(settings);
</script>

You can combine both percent-based values and second-based values for midroll attribute

Cycling video ads in a live stream

For live video streaming you can display mid-roll video ads at fixed or flexible intervals. In the following example a pre-roll is played when the live player is started and mid-roll video ads are played every 2 minutes (when the player is not paused) for the first 10 minutes of the live stream:

<script src="https://cdn.radiantmediatechs.com/rmp/6.4.10/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  // Streaming source - HLS in this example
  var src = {
    hls: 'https://your-live-hls-url.m3u8'
  };
  // Define ad schedule
  var schedule = {
    // Preroll
    preroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // Midroll: a mid-roll ad is played every 120 seconds (2 minutes) for the first 10 minutes of live video
    midroll: [
      [120, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'],
      [240, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'],
      [360, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'],
      [480, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'],
      [600, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml']
    ]
  };
  var settings = {
    licenseKey: 'your-license-key',
    width: 640,
    height: 360,
    src: src,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    ads: true,
    // Pass ad schedule
    adSchedule: schedule
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  rmp.init(settings);
</script>

Mid-roll video ads using the midrollRepeat attribute (live or on-demand video)

The midrollRepeat attribute lets you repeat a request to a specific adTag at regular intervals.

<script src="https://cdn.radiantmediatechs.com/rmp/6.4.10/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  // Streaming source - MP4 progressive download in this example
  var src = {
    mp4: [
      'https://your-mp4-url.mp4'
    ]
  };
  // Define ad schedule
  var schedule = {
    // Preroll
    preroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // Midroll: every 60 seconds the player will attempt to load a video ad at the given URL.
    midrollRepeat: [60, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml']
  };
  var settings = {
    licenseKey: 'your-license-key',
    width: 640,
    height: 360,
    src: src,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    ads: true,
    // Pass ad schedule
    adSchedule: schedule
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  rmp.init(settings);
</script>

Waterfalling with ad scheduling

The adScheduleWaterfall setting will let you add client-side waterfalling to your ad-schedule.

<script src="https://cdn.radiantmediatechs.com/rmp/6.4.10/js/rmp.min.js"></script>
<div id="rmpPlayer"></div>
<script>
  // Streaming source - MP4 progressive download in this example
  var src = {
    hls: 'https://your-hls-url.m3u8'
  };
  var adScheduleWaterfall = [
    'https://your-fallback-ad-tag-url-1',
    'https://your-fallback-ad-tag-url-2',
    'https://your-fallback-ad-tag-url-3'
  ];
  // Define ad schedule
  var schedule = {
    // Preroll
    preroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml',
    // Midroll at 30 seconds
    midroll: [
      [30, 'https://www.radiantmediaplayer.com/vast/tags/inline-linear-skippable.xml']
    ],
    // Postroll
    postroll: 'https://www.radiantmediaplayer.com/vast/tags/inline-linear.xml'
  };
  var settings = {
    licenseKey: 'your-license-key',
    width: 640,
    height: 360,
    src: src,
    contentMetadata: {
      poster: [
        'https://your-poster-url.jpg'
      ]
    },
    ads: true,
    // Pass ad schedule
    adSchedule: schedule,
    // Pass waterfall Array for ad schedule
    adScheduleWaterfall: adScheduleWaterfall
  };
  var elementID = 'rmpPlayer';
  var rmp = new RadiantMP(elementID);
  rmp.init(settings);
</script>

Ad-scheduling with Prebis.js

The adScheduleCallback setting will let you add a custom callback before video ads are requested in an ad-schedule.

We have published an example for using adScheduleCallback setting to enable header bidding through Prebid.js in an ad-schedule on our GitHub repository.

Additional support notes

  • Mid-roll timestamps must be expressed in seconds
  • For live video content do not include post-roll data as this would be irrelevant
  • The midrollRepeat setting is capped at 50 midroll ads impression
  • Mid-roll or post-roll video ads are not supported with DVR streaming (only pre-roll linear video ads or overlay ads are currently supported)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License.

©2015-2021 Radiant Media Player. All rights reserved.