AndroidVideoView icon indicating copy to clipboard operation
AndroidVideoView copied to clipboard

formatTime return wrong information!

Open IRMobydick opened this issue 10 years ago • 0 comments

Your formatTime method return wrong information. I use of this method instead of yours:

in MainActivity class define these two: StringBuilder mFormatBuilder; Formatter mFormatter;

in onCreate defined these two like this: mFormatBuilder = new StringBuilder(); mFormatter = new Formatter(mFormatBuilder, Locale.getDefault());

and finally new formatTime method:

private String formatTime(int timeMs) {
    int totalSeconds = timeMs / 1000;

    int seconds = totalSeconds % 60;
    int minutes = (totalSeconds / 60) % 60;
    int hours   = totalSeconds / 3600;

    mFormatBuilder.setLength(0);
    if (hours > 0) {
        return mFormatter.format("%d:%02d:%02d", hours, minutes, seconds).toString();
    } else {
        return mFormatter.format("%02d:%02d", minutes, seconds).toString();
    }
}

this new formatTime return right infromation to us :)

Do you have any solution to preventing lose buffered portion when activity come back to resume after goes to pause?!

Thank for sharing your library.

IRMobydick avatar Apr 03 '15 16:04 IRMobydick