I'm developing a video player and am trying to get the seconds and minutes to reset at 60 seconds/minutes.
At the moment I can get it to run perfectly but I cant reset the Integer/String to 00 when it hits 60.
How do i do this?
My current code:
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);
Thanks in advance