Can I have multiple ads schedule?

Is there any ways we can add multiple ads in one video, For example, one preroll ads and one ads in mid-roll/or any insertions in video.

Yes, you can add an array of ads with different positions, as shown in the following example

conf.advertising = {
  adBreaks: [{
    tag: {
      url: 'http://your.ad.provider/vmap-manifest.xml',
      type: 'vmap'
    },
  }, {
    tag: {
      url: 'http://your.ad.provider/vast-manifest.xml',
      type: 'vast'
    },
    replaceContentDuration: 5,
    persistent: true,
    id: 'pre-roll-1',
    position: 'pre',
  }, {
    tag: {
      url: 'http://your.ad.provider/vast-manifest.xml',
      type: 'vast'
    },
    id: 'mid-roll-1',
    position: '00:08:30.000',
    preloadOffset: 5
  }, {
    tag: {
      url: 'http://your.ad.provider/vast-manifest.xml',
      type: 'vast'
    },
    persistent: true,
    id: 'post-roll-1',
    position: 'post',
    preloadOffset: 5
  }],
}

(source AdvertisingConfig | Bitmovin Player API 8.120.0)

Let us know in case you have any questions

1 Like

Thanks Ludo, you are a great champion! Does this work on live stream as well? as we cannot predict how long the live stream will be?

And also does the ads time will be included in the whole video time? cause I got a issue like this: the whole video time is 15s long, ads video time is around 15s as well. I set up a pre-roll ads and a mid-roll ads with the position: “pre” and position:“50%” . the mid-roll was expected to start to play at around 8 seconds in the video. but actually the mid-roll ads was played afterwards the pro-roll ads. is there any way we can fix this? many thanks

You can schedule ads on live streams dynamically with the schedule API.

Example

player.ads.schedule({
  tag: {
    url: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
    type: "vast"
  },
  id: 'Ad',
  position: "pre"
});

The ads don’t replace the video by default unless you specify it in the configuration
https://cdn.bitmovin.com/player/web/8/docs/interfaces/advertising.adtagconfig.html#replacecontentduration

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.