Commit 8588bdb0 by Oliver Woodman

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

PiperOrigin-RevId: 381833313
parents bb82e7df efc6992e
...@@ -231,23 +231,11 @@ import java.util.List; ...@@ -231,23 +231,11 @@ import java.util.List;
} }
public boolean skipToPreviousPlaylistItem() { public boolean skipToPreviousPlaylistItem() {
Timeline timeline = player.getCurrentTimeline(); return controlDispatcher.dispatchPrevious(player);
Assertions.checkState(!timeline.isEmpty());
int previousWindowIndex = player.getPreviousWindowIndex();
if (previousWindowIndex != C.INDEX_UNSET) {
return controlDispatcher.dispatchSeekTo(player, previousWindowIndex, C.TIME_UNSET);
}
return false;
} }
public boolean skipToNextPlaylistItem() { public boolean skipToNextPlaylistItem() {
Timeline timeline = player.getCurrentTimeline(); return controlDispatcher.dispatchNext(player);
Assertions.checkState(!timeline.isEmpty());
int nextWindowIndex = player.getNextWindowIndex();
if (nextWindowIndex != C.INDEX_UNSET) {
return controlDispatcher.dispatchSeekTo(player, nextWindowIndex, C.TIME_UNSET);
}
return false;
} }
public boolean skipToPlaylistItem(@IntRange(from = 0) int index) { public boolean skipToPlaylistItem(@IntRange(from = 0) int index) {
......
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