//
//  MKRPlayResourceStatus.m
//  MKRAVPlayer
//
//  Created by yyqxiaoyin on 2019/4/11.
//

#import "MKRPlayResourceStatus.h"

@implementation MKRPlayResourceStatus

- (NSString *)currentTimeFormatString {
    if (self.currentTime == 0){
        return @"00:00";
    }
    int seconds = self.currentTime % 60;
    int minutes = (self.currentTime / 60) % 60;
    int hours = self.currentTime / 3600;
    if (hours){
        return [NSString stringWithFormat:@"%02d:%02d",minutes,seconds];
    } else{
        return [NSString stringWithFormat:@"%02d:%02d:%02d",hours,minutes,seconds];
    }
}

- (NSString *)totalTimeFormatString {
    if (self.totalTime == 0){
        return @"00:00";
    }
    int seconds = self.totalTime % 60;
    int minutes = (self.totalTime / 60) % 60;
    int hours = self.totalTime / 3600;
    if (!hours){
        return [NSString stringWithFormat:@"%02d:%02d",minutes,seconds];
    } else{
        return [NSString stringWithFormat:@"%02d:%02d:%02d",hours,minutes,seconds];
    }
}

@end
