我正在开发一个视频播放器,并试图让秒和分钟重置为 60 秒/分钟。
目前我可以让它完美运行,但是当它达到 60 时,我无法将 Integer/String 重置为 00。
我该怎么做呢?
我当前的代码:
pos = vv.getCurrentPosition();
sec = pos / 1000;
min = pos / 60000;
hr = pos / 3600000;
if (sec == 60) {
sec = vv.getCurrentPosition();
}
if (min == 60) {
min = vv.getCurrentPosition();
}
secs = Integer.toString(sec);
mins = Integer.toString(min) + ":";
hrs = Integer.toString(hr) + ":";
if (sec < 10) {
secs = "0" + sec;
}
if (min < 10) {
mins = "0" + min + ":";
}
if (hr < 10) {
hrs = "0" + hr + ":";
}
if (hr == 00) {
hrs = "";
}
hms = hrs + mins + secs;
tvProgress.setText(hms);
提前致谢