mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Merge pull request #9119 from chvp:media2-dispatch-previous-next
PiperOrigin-RevId: 381833313
This commit is contained in:
commit
8588bdb02a
1 changed files with 2 additions and 14 deletions
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue