Skip to content

Commit

Permalink
Releases/v3.5.0
Browse files Browse the repository at this point in the history
## New
* `MuxErrorException` now allows you to report non-fatal and business-related errors

## Improvements
* Updated MuxCore to version 8.0.0
* Updated Android Core to version 1.2.0

## Fixes
* fix: Capture IMA CSAI media failures with LOG events (#367 )


Co-authored-by: Emily Dixon <[email protected]>
Co-authored-by: GitHub <[email protected]>
  • Loading branch information
daytime-em and web-flow authored Apr 6, 2024
1 parent 7fc27f0 commit ca9dc98
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import com.mux.stats.sdk.core.events.EventBus
import com.mux.stats.sdk.core.events.playback.*
import com.mux.stats.sdk.core.model.AdData
import com.mux.stats.sdk.core.model.ViewData
import com.mux.stats.sdk.core.util.MuxLogger
import com.mux.stats.sdk.muxstats.internal.oneOf
import com.mux.stats.sdk.muxstats.internal.weak
import com.mux.stats.sdk.core.events.playback.AdEvent as MuxAdEvent
Expand All @@ -22,6 +23,9 @@ class AdsImaSDKListener private constructor(
) : AdErrorEvent.AdErrorListener, AdEvent.AdEventListener {

companion object {

private const val TAG = "AdsImaSDKListener"

@JvmSynthetic
internal fun createIfImaAvailable(
exoPlayer: ExoPlayer,
Expand Down Expand Up @@ -177,6 +181,18 @@ class AdsImaSDKListener private constructor(
dispatchAdPlaybackEvent(AdPlayingEvent(null), ad)
}
AdEvent.AdEventType.ALL_ADS_COMPLETED -> {}
AdEvent.AdEventType.LOG -> {
val data = adEvent.adData
// theoretically LOG could be for things other than errors so at least do this check
if (data["errorMessage"] != null
|| data["errorCode"] != null
|| data["innerError"] != null
) {
dispatchAdPlaybackEvent(AdErrorEvent(null), adEvent.ad)
} else {
MuxLogger.d(TAG, "Logged IMA event: $adEvent")
}
}
else -> return
}
}
Expand Down

0 comments on commit ca9dc98

Please sign in to comment.