Merge pull request #9119 from chvp:media2-dispatch-previous-next

PiperOrigin-RevId: 381833313
This commit is contained in:
Oliver Woodman 2021-06-30 13:41:35 +01:00 committed by Ian Baker
parent baa9a367e2
commit 125a8d3caa

View file

@ -231,23 +231,11 @@ import java.util.List;
}
public boolean skipToPreviousPlaylistItem() {
Timeline timeline = player.getCurrentTimeline();
Assertions.checkState(!timeline.isEmpty());
int previousWindowIndex = player.getPreviousWindowIndex();
if (previousWindowIndex != C.INDEX_UNSET) {
return controlDispatcher.dispatchSeekTo(player, previousWindowIndex, C.TIME_UNSET);
}
return false;
return controlDispatcher.dispatchPrevious(player);
}
public boolean skipToNextPlaylistItem() {
Timeline timeline = player.getCurrentTimeline();
Assertions.checkState(!timeline.isEmpty());
int nextWindowIndex = player.getNextWindowIndex();
if (nextWindowIndex != C.INDEX_UNSET) {
return controlDispatcher.dispatchSeekTo(player, nextWindowIndex, C.TIME_UNSET);
}
return false;
return controlDispatcher.dispatchNext(player);
}
public boolean skipToPlaylistItem(@IntRange(from = 0) int index) {