com.google.android.exoplayer2.util.Util.getStringForTime()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(218)

本文整理了Java中com.google.android.exoplayer2.util.Util.getStringForTime()方法的一些代码示例,展示了Util.getStringForTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getStringForTime()方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称:Util
方法名:getStringForTime

Util.getStringForTime介绍

[英]Returns the specified millisecond time formatted as a string.
[中]返回格式为字符串的指定毫秒时间。

代码示例

代码示例来源:origin: google/ExoPlayer

private String getProgressText() {
 return Util.getStringForTime(formatBuilder, formatter, position);
}

代码示例来源:origin: google/ExoPlayer

@Override
public void onScrubMove(TimeBar timeBar, long position) {
 if (positionView != null) {
  positionView.setText(Util.getStringForTime(formatBuilder, formatter, position));
 }
}

代码示例来源:origin: google/ExoPlayer

durationView.setText(Util.getStringForTime(formatBuilder, formatter, duration));
positionView.setText(Util.getStringForTime(formatBuilder, formatter, position));

代码示例来源:origin: JarvanMo/ExoVideoView

@Override
public void onScrubMove(TimeBar timeBar, long position) {
  if (positionView != null) {
    positionView.setText(Util.getStringForTime(formatBuilder, formatter, position));
  }
}

代码示例来源:origin: VRGsoftUA/VideoCrop

@Override
  public void seekBarValueChanged(long leftThumb, long rightThumb) {
    if (mTmbProgress.getSelectedThumb() == 1) {
      mVideoPlayer.seekTo(leftThumb);
    }

    mTvDuration.setText(Util.getStringForTime(formatBuilder, formatter, rightThumb));
    mTvProgress.setText(Util.getStringForTime(formatBuilder, formatter, leftThumb));
  }
}

代码示例来源:origin: JarvanMo/ExoVideoView

private CharSequence generateFastForwardOrRewindTxt(long changingTime) {
  long duration = player == null ? 0 : player.getDuration();
  String result = Util.getStringForTime(formatBuilder, formatter, changingTime);
  result = result + "/";
  result = result + Util.getStringForTime(formatBuilder, formatter, duration);
  int index = result.indexOf("/");
  SpannableString spannableString = new SpannableString(result);
  TypedValue typedValue = new TypedValue();
  TypedArray a = getContext().obtainStyledAttributes(typedValue.data, new int[]{R.attr.colorAccent});
  int color = a.getColor(0, 0);
  a.recycle();
  spannableString.setSpan(new ForegroundColorSpan(color), 0, index, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
  spannableString.setSpan(new ForegroundColorSpan(Color.WHITE), index, result.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
  return spannableString;
}

代码示例来源:origin: VRGsoftUA/VideoCrop

long startCrop = mTmbProgress.getLeftProgress();
long durationCrop = mTmbProgress.getRightProgress() - mTmbProgress.getLeftProgress();
String start = Util.getStringForTime(formatBuilder, formatter, startCrop);
String duration = Util.getStringForTime(formatBuilder, formatter, durationCrop);
start += "." + startCrop % 1000;
duration += "." + durationCrop % 1000;

代码示例来源:origin: JarvanMo/ExoVideoView

durationView.setText(Util.getStringForTime(formatBuilder, formatter, duration));
String positionStr = Util.getStringForTime(formatBuilder, formatter, position);
String durationStr = Util.getStringForTime(formatBuilder, formatter, duration);
durationViewLandscape.setText(positionStr.concat("/").concat(durationStr));
positionView.setText(Util.getStringForTime(formatBuilder, formatter, position));

相关文章