If FlowplayerView was prepared with a valid FlowplayerVideo then a Flowplayer config will be fetched and all the ads that are included in this config will automatically play at their specified time offsets.
Create an ExternalVideo with a URL to an ad playlist, such as VMAP:
val externalVideo = ExternalVideo("https://link.to.a.media.file", "https://link.to.a.vmap.file")
Creating ad breaks manually
Create an ExternalVideo with a list of AdBreak objects, where each AdBreak consists of one or more ad tag URLs (such as VAST) and an offset which indicates the time when the break should start. The following example creates an ad schedule that consists of:
a pre-roll break with a single ad,
a mid-roll break with three ads which starts 15 seconds into the playback,
a post-roll break with a single ad.
val preRollBreak = AdBreak("https://link.to.a.vast.file", AdBreak.Roll.PRE)
val midRolls = arrayListOf("https://link.to.a.vast.file", "https://link.to.a.vast.file", "https://link.to.a.vast.file")
val midRollBreak = AdBreak(midRolls, 15)
val postRollBreak = AdBreak("https://link.to.a.vast.file", AdBreak.Roll.POST)
val adSchedule = arrayListOf(preRollBreak, midRollBreak, postRollBreak)
val externalVideo = ExternalVideo("https://url.to.a.media.file", adSchedule)