本文整理了Java中com.google.android.exoplayer2.util.Util.getStringForTime()
方法的一些代码示例,展示了Util.getStringForTime()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getStringForTime()
方法的具体详情如下:
包路径:com.google.android.exoplayer2.util.Util
类名称: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));
内容来源于网络,如有侵权,请联系作者删除!