Commit 31897af1 by bachinger

Avoid media item transitions for auto discontinuities when ads involved

#minor-release

PiperOrigin-RevId: 372433555
parent c97956ea
......@@ -51,6 +51,8 @@
* Added a combined and structured metadata object (`MediaMetadata`) to
Player, accessible through `getMediaMetadata` or by listening to
`EventListener.onMediaMetadataChanged`.
* Fix bug when transitions from content to ad periods called
`onMediaItemTransition` by mistake.
* UI:
* Add builder for `PlayerNotificationManager`.
* Add group setting to `PlayerNotificationManager`.
......
......@@ -1462,7 +1462,6 @@ import java.util.concurrent.CopyOnWriteArraySet;
int newWindowIndex =
newTimeline.getPeriodByUid(playbackInfo.periodId.periodUid, period).windowIndex;
Object newWindowUid = newTimeline.getWindow(newWindowIndex, window).uid;
int firstPeriodIndexInNewWindow = window.firstPeriodIndex;
if (!oldWindowUid.equals(newWindowUid)) {
@Player.MediaItemTransitionReason int transitionReason;
if (positionDiscontinuity
......@@ -1480,8 +1479,8 @@ import java.util.concurrent.CopyOnWriteArraySet;
return new Pair<>(/* isTransitioning */ true, transitionReason);
} else if (positionDiscontinuity
&& positionDiscontinuityReason == DISCONTINUITY_REASON_AUTO_TRANSITION
&& newTimeline.getIndexOfPeriod(playbackInfo.periodId.periodUid)
== firstPeriodIndexInNewWindow) {
&& oldPlaybackInfo.periodId.windowSequenceNumber
< playbackInfo.periodId.windowSequenceNumber) {
return new Pair<>(/* isTransitioning */ true, MEDIA_ITEM_TRANSITION_REASON_REPEAT);
}
return new Pair<>(/* isTransitioning */ false, /* mediaItemTransitionReason */ C.INDEX_UNSET);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment