本文整理匯總了Java中com.google.android.exoplayer.ExoPlayer.UNKNOWN_TIME屬性的典型用法代碼示例。如果您正苦於以下問題:Java ExoPlayer.UNKNOWN_TIME屬性的具體用法?Java ExoPlayer.UNKNOWN_TIME怎麽用?Java ExoPlayer.UNKNOWN_TIME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.google.android.exoplayer.ExoPlayer
的用法示例。
在下文中一共展示了ExoPlayer.UNKNOWN_TIME屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onFastForward
@Override
public void onFastForward() {
if (mPlayer.getDuration() != ExoPlayer.UNKNOWN_TIME) {
// Fast forward 10 seconds.
int prevState = getPlaybackState();
setPlaybackState(PlaybackState.STATE_FAST_FORWARDING);
setPosition(mPlayer.getCurrentPosition() + (10 * 1000));
setPlaybackState(prevState);
}
}
示例2: getDuration
public long getDuration() {
if (mPlayer != null) {
return mPlayer.getDuration();
}
return ExoPlayer.UNKNOWN_TIME;
}
示例3: getCurrentPosition
@Override
public int getCurrentPosition() {
return exoPlayer.getDuration() == ExoPlayer.UNKNOWN_TIME ? 0
: (int) exoPlayer.getCurrentPosition();
}
示例4: getDuration
@Override
public int getDuration() {
return exoPlayer.getDuration() == ExoPlayer.UNKNOWN_TIME ? 0
: (int) exoPlayer.getDuration();
}
示例5: seekTo
@Override
public void seekTo(int timeMillis) {
long seekPosition = exoPlayer.getDuration() == ExoPlayer.UNKNOWN_TIME ? 0
: Math.min(Math.max(0, timeMillis), getDuration());
exoPlayer.seekTo(seekPosition);
}