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

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

本文整理了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

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

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

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

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

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

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

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

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

  1. @Override
  2. public void seekBarValueChanged(long leftThumb, long rightThumb) {
  3. if (mTmbProgress.getSelectedThumb() == 1) {
  4. mVideoPlayer.seekTo(leftThumb);
  5. }
  6. mTvDuration.setText(Util.getStringForTime(formatBuilder, formatter, rightThumb));
  7. mTvProgress.setText(Util.getStringForTime(formatBuilder, formatter, leftThumb));
  8. }
  9. }

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

  1. private CharSequence generateFastForwardOrRewindTxt(long changingTime) {
  2. long duration = player == null ? 0 : player.getDuration();
  3. String result = Util.getStringForTime(formatBuilder, formatter, changingTime);
  4. result = result + "/";
  5. result = result + Util.getStringForTime(formatBuilder, formatter, duration);
  6. int index = result.indexOf("/");
  7. SpannableString spannableString = new SpannableString(result);
  8. TypedValue typedValue = new TypedValue();
  9. TypedArray a = getContext().obtainStyledAttributes(typedValue.data, new int[]{R.attr.colorAccent});
  10. int color = a.getColor(0, 0);
  11. a.recycle();
  12. spannableString.setSpan(new ForegroundColorSpan(color), 0, index, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
  13. spannableString.setSpan(new ForegroundColorSpan(Color.WHITE), index, result.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
  14. return spannableString;
  15. }

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

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

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

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

相关文章