Skip to content

Commit

Permalink
Ima ads event data populated. (#30)
Browse files Browse the repository at this point in the history
* Ima ads event data populated.

* fix: check playhead time before setting preroll metadata
  • Loading branch information
tomkordic committed Jan 3, 2024
1 parent 2fbf09f commit 7b38884
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions MUXSDKImaListener/Classes/MuxImaListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 49 in MUXSDKImaListener/Classes/MuxImaListener.m

View workflow job for this annotation

GitHub Actions / Test the SDK with a Demo App

'universalAdIdValue' is deprecated: Use universalAdIDs instead. [-Wdeprecated-declarations]
event.adData = adData;
}
event.viewData = viewData;
}
Expand Down

0 comments on commit 7b38884

Please sign in to comment.