Description
We are updating ExoPlayer in our project from version 2.13.2 to 2.15.1. We are using modified IMA extension because of feature described in issue 8810. We had to change adPlaybackState.adGroups[i] = AdPlaybackState.AdGroup().withAdCount(1).withAdState(AdPlaybackState.AD_STATE_PLAYED, 0)
to adPlaybackState = adPlaybackState.withNewAdGroup(i, timeUs).withAdCount(i, 1).withPlayedAd(i, 0)
and adPlaybackState.adGroups[i] = AdPlaybackState.AdGroup()
to adPlaybackState = adPlaybackState.withNewAdGroup(i, adTimeUs)
. But it looks like there are some internal changes and our application is crashing in newly added check on line 285 in AdsMediaSource that was not in 2.13.2 version.
Could you please help us how to set AdGroup
directly into AdPlaybackState.adGroups
and avoid increasing the AdPlaybackState.adGroupCount
? Our code is in Kotlin language and we created extension AdPlaybackState.setAdGroup(index: Int, adGroup: AdPlaybackState.AdGroup)
that is using reflection to set an AdGroup
into AdPlaybackState.adGroups
. But using reflection is not the best solution. Thanks!
Activity