mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix skipping behavior in ad pods
ImaAdsLoader notified onEnded whenever an ad finished playing, but when an ad is skipped in an ad pod we'd receive a playAd call before the player discontinuity for skipping to the next ad. Fix this behavior by checking that IMA's playing ad matches the player's playing ad before notifying onEnded. #minor-release PiperOrigin-RevId: 339424910
This commit is contained in:
parent
2c746c6b6b
commit
de729ecf3a
2 changed files with 12 additions and 5 deletions
|
|
@ -35,6 +35,8 @@
|
||||||
([#7344](https://github.com/google/ExoPlayer/issues/7344)).
|
([#7344](https://github.com/google/ExoPlayer/issues/7344)).
|
||||||
* Improve handling of ad tags with unsupported VPAID ads
|
* Improve handling of ad tags with unsupported VPAID ads
|
||||||
([#7832](https://github.com/google/ExoPlayer/issues/7832)).
|
([#7832](https://github.com/google/ExoPlayer/issues/7832)).
|
||||||
|
* Fix a bug that caused multiple ads in an ad pod to be skipped when one
|
||||||
|
ad in the ad pod was skipped.
|
||||||
|
|
||||||
### 2.12.1 (2020-10-23) ###
|
### 2.12.1 (2020-10-23) ###
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1300,13 +1300,18 @@ public final class ImaAdsLoader
|
||||||
if (adMediaInfo == null) {
|
if (adMediaInfo == null) {
|
||||||
Log.w(TAG, "onEnded without ad media info");
|
Log.w(TAG, "onEnded without ad media info");
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < adCallbacks.size(); i++) {
|
@Nullable AdInfo adInfo = adInfoByAdMediaInfo.get(adMediaInfo);
|
||||||
adCallbacks.get(i).onEnded(adMediaInfo);
|
if (playingAdIndexInAdGroup == C.INDEX_UNSET
|
||||||
|
|| (adInfo != null && adInfo.adIndexInAdGroup < playingAdIndexInAdGroup)) {
|
||||||
|
for (int i = 0; i < adCallbacks.size(); i++) {
|
||||||
|
adCallbacks.get(i).onEnded(adMediaInfo);
|
||||||
|
}
|
||||||
|
if (configuration.debugModeEnabled) {
|
||||||
|
Log.d(
|
||||||
|
TAG, "VideoAdPlayerCallback.onEnded in onTimelineChanged/onPositionDiscontinuity");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (configuration.debugModeEnabled) {
|
|
||||||
Log.d(TAG, "VideoAdPlayerCallback.onEnded in onTimelineChanged/onPositionDiscontinuity");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!sentContentComplete && !wasPlayingAd && playingAd && imaAdState == IMA_AD_STATE_NONE) {
|
if (!sentContentComplete && !wasPlayingAd && playingAd && imaAdState == IMA_AD_STATE_NONE) {
|
||||||
int adGroupIndex = player.getCurrentAdGroupIndex();
|
int adGroupIndex = player.getCurrentAdGroupIndex();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue