Skip to content

Commit

Permalink
Add UplynkAdBreak and UplynkAd as a customData in SSAI
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegRyz committed Sep 6, 2024
1 parent 0845106 commit 631a48f
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ internal class AdHandler(private val controller: ServerSideAdIntegrationControll
private val scheduledAds = WeakHashMap<UplynkAd, Ad>()

fun createAdBreak(adBreak: UplynkAdBreak) {
val adBreakInit = AdBreakInit(adBreak.timeOffset.secToMs, adBreak.duration.secToMs)
val adBreakInit = AdBreakInit(
timeOffset = adBreak.timeOffset.secToMs,
maxDuration = adBreak.duration.secToMs,
customData = adBreak
)
val currentAdBreak = controller.createAdBreak(adBreakInit)
adBreak.ads.forEach {
val adInit = AdInit(type = adBreak.type, duration = it.duration.secToMs)
val adInit = AdInit(
type = adBreak.type,
duration = it.duration.secToMs,
customData = it
)
scheduledAds[it] = controller.createAd(adInit, currentAdBreak)
}
}
Expand Down

0 comments on commit 631a48f

Please sign in to comment.