From 7b388841a21995c6619233f08f196b26f78e3d29 Mon Sep 17 00:00:00 2001 From: Tomislav Kordic <32546640+tomkordic@users.noreply.github.com> Date: Wed, 3 Jan 2024 20:54:05 +0100 Subject: [PATCH] Ima ads event data populated. (#30) * Ima ads event data populated. * fix: check playhead time before setting preroll metadata --- MUXSDKImaListener/Classes/MuxImaListener.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/MUXSDKImaListener/Classes/MuxImaListener.m b/MUXSDKImaListener/Classes/MuxImaListener.m index 2295494..59873d8 100644 --- a/MUXSDKImaListener/Classes/MuxImaListener.m +++ b/MUXSDKImaListener/Classes/MuxImaListener.m @@ -33,17 +33,21 @@ - (id)initWithPlayerBinding:(MUXSDKPlayerBinding *)binding options:(MuxImaListen - (void)setupAdViewData:(MUXSDKAdEvent *)event withAd:(IMAAd *)ad { MUXSDKViewData *viewData = [MUXSDKViewData new]; MUXSDKAdData *adData = [MUXSDKAdData new]; - if ([_playerBinding getCurrentPlayheadTimeMs] < 1000) { - if (ad != nil) { + if (ad != nil) { + + if ([_playerBinding getCurrentPlayheadTimeMs] < 1000) { viewData.viewPrerollAdId = ad.adId; viewData.viewPrerollCreativeId = ad.creativeID; - - adData.adId = ad.adId; - adData.adCreativeId = ad.creativeID; - // universalAdIdValue is deprecated, but used for parity with web&android - adData.adUniversalId = ad.universalAdIdValue; - event.adData = adData; } + + adData.adId = ad.adId; + adData.adCreativeId = ad.creativeID; + + // TODO: use newer IMA API here. universalAdIdValue + // is deprecated, but used for time being for parity + // with web&android + adData.adUniversalId = ad.universalAdIdValue; + event.adData = adData; } event.viewData = viewData; }