Skip to content

Commit

Permalink
Track CSAI ad media failures
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em committed Apr 2, 2024
1 parent 7b38884 commit dccb50e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions MUXSDKImaListener/Classes/MuxImaListener.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ - (void)setupAdViewData:(MUXSDKAdEvent *)event withAd:(IMAAd *)ad {

- (MUXSDKAdEvent *_Nullable) dispatchEvent:(IMAAdEvent *)event {
MUXSDKAdEvent *playbackEvent;

NSDictionary *adData = event.adData;

switch(event.type) {
case kIMAAdEvent_LOADED:
playbackEvent = [MUXSDKAdResponseEvent new];
Expand Down Expand Up @@ -86,6 +89,16 @@ - (MUXSDKAdEvent *_Nullable) dispatchEvent:(IMAAdEvent *)event {
[_playerBinding dispatchAdEvent: playbackEvent];
playbackEvent = [MUXSDKAdPlayingEvent new];
break;
case kIMAAdEvent_LOG:
if (adData && adData[@"logData"]) {
NSDictionary *errorLog = (NSDictionary *)adData[@"logData"];
if (errorLog) {
if (errorLog[@"errorCode"] || errorLog[@"errorMessage"] || errorLog[@"type"]) {
playbackEvent = [[MUXSDKAdErrorEvent alloc] init];
}
}
}
break;
default:
break;
}
Expand Down

0 comments on commit dccb50e

Please sign in to comment.