本文整理了Java中com.google.android.exoplayer2.Timeline.getNextWindowIndex()
方法的一些代码示例,展示了Timeline.getNextWindowIndex()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Timeline.getNextWindowIndex()
方法的具体详情如下:
包路径:com.google.android.exoplayer2.Timeline
类名称:Timeline
方法名:getNextWindowIndex
[英]Returns the index of the window after the window at index windowIndex depending on the repeatMode and whether shuffling is enabled.
[中]根据repeatMode和是否启用混洗,在index windowIndex处返回窗口后的窗口索引。
代码示例来源:origin: google/ExoPlayer
@Override
public int getNextWindowIndex(int windowIndex, @Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled) {
return timeline.getNextWindowIndex(windowIndex, repeatMode, shuffleModeEnabled);
}
代码示例来源:origin: google/ExoPlayer
@Override
public int getNextWindowIndex(int windowIndex, @Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled) {
int childNextWindowIndex = timeline.getNextWindowIndex(windowIndex, repeatMode,
shuffleModeEnabled);
return childNextWindowIndex == C.INDEX_UNSET ? getFirstWindowIndex(shuffleModeEnabled)
: childNextWindowIndex;
}
代码示例来源:origin: google/ExoPlayer
/**
* Asserts that next window indices for each window depending on the repeat mode and the shuffle
* mode are equal to the given sequence.
*/
public static void assertNextWindowIndices(
Timeline timeline,
@Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled,
int... expectedNextWindowIndices) {
for (int i = 0; i < timeline.getWindowCount(); i++) {
assertThat(timeline.getNextWindowIndex(i, repeatMode, shuffleModeEnabled))
.isEqualTo(expectedNextWindowIndices[i]);
}
}
代码示例来源:origin: google/ExoPlayer
/**
* Returns the index of the period after the period at index {@code periodIndex} depending on the
* {@code repeatMode} and whether shuffling is enabled.
*
* @param periodIndex Index of a period in the timeline.
* @param period A {@link Period} to be used internally. Must not be null.
* @param window A {@link Window} to be used internally. Must not be null.
* @param repeatMode A repeat mode.
* @param shuffleModeEnabled Whether shuffling is enabled.
* @return The index of the next period, or {@link C#INDEX_UNSET} if this is the last period.
*/
public final int getNextPeriodIndex(int periodIndex, Period period, Window window,
@Player.RepeatMode int repeatMode, boolean shuffleModeEnabled) {
int windowIndex = getPeriod(periodIndex, period).windowIndex;
if (getWindow(windowIndex, window).lastPeriodIndex == periodIndex) {
int nextWindowIndex = getNextWindowIndex(windowIndex, repeatMode, shuffleModeEnabled);
if (nextWindowIndex == C.INDEX_UNSET) {
return C.INDEX_UNSET;
}
return getWindow(nextWindowIndex, window).firstPeriodIndex;
}
return periodIndex + 1;
}
代码示例来源:origin: google/ExoPlayer
@Override
public final int getNextWindowIndex() {
Timeline timeline = getCurrentTimeline();
return timeline.isEmpty()
? C.INDEX_UNSET
: timeline.getNextWindowIndex(
getCurrentWindowIndex(), getRepeatModeForNavigation(), getShuffleModeEnabled());
}
代码示例来源:origin: google/ExoPlayer
/**
* Asserts that next window indices for each window depending on the repeat mode and the shuffle
* mode are equal to the given sequence.
*/
public static void assertNextWindowIndices(
Timeline timeline,
@Player.RepeatMode int repeatMode,
boolean shuffleModeEnabled,
int... expectedNextWindowIndices) {
for (int i = 0; i < timeline.getWindowCount(); i++) {
assertThat(timeline.getNextWindowIndex(i, repeatMode, shuffleModeEnabled))
.isEqualTo(expectedNextWindowIndices[i]);
}
}
代码示例来源:origin: google/ExoPlayer
.isEqualTo(i + 1);
} else {
int nextWindow = timeline.getNextWindowIndex(expectedWindowIndex, repeatMode, false);
int nextPeriod =
nextWindow == C.INDEX_UNSET ? C.INDEX_UNSET : accumulatedPeriodCounts[nextWindow];
代码示例来源:origin: google/ExoPlayer
.isEqualTo(i + 1);
} else {
int nextWindow = timeline.getNextWindowIndex(expectedWindowIndex, repeatMode, false);
int nextPeriod =
nextWindow == C.INDEX_UNSET ? C.INDEX_UNSET : accumulatedPeriodCounts[nextWindow];
代码示例来源:origin: google/ExoPlayer
int nextWindowIndexInChild = getTimelineByChildIndex(childIndex).getNextWindowIndex(
windowIndex - firstWindowIndexInChild,
repeatMode == Player.REPEAT_MODE_ALL ? Player.REPEAT_MODE_OFF : repeatMode,
代码示例来源:origin: ChangWeiBa/AesExoPlayer
/**
* 下一首
*/
private void next() {
Timeline timeline = player.getCurrentTimeline();
if (timeline.isEmpty()) {
return;
}
int windowIndex = player.getCurrentWindowIndex();
Timber.e("windowIndex:" + windowIndex);
int nextWindowIndex = timeline.getNextWindowIndex(windowIndex, player.getRepeatMode());
Timber.e("nextWindowIndex:" + nextWindowIndex);
Timber.e("isDynamic:" + window.isDynamic);
Timber.e("TIME_UNSET:" + C.TIME_UNSET);
if (nextWindowIndex != C.INDEX_UNSET) {
player.seekTo(nextWindowIndex, C.TIME_UNSET);
} else if (timeline.getWindow(windowIndex, window, false).isDynamic) {
player.seekTo(windowIndex, C.TIME_UNSET);
Timber.e("已经最后一首");
}
}
内容来源于网络,如有侵权,请联系作者删除!