- (NSString *)getVideoFileDuration:(NSString *)fileName {
NSString *videoFilePath = [[self localVideoStorageDir] stringByAppendingPathComponent:fileName];
NSURL *url = [NSURL fileURLWithPath:videoFilePath];
AVURLAsset *sourceAsset = [AVURLAsset URLAssetWithURL:url options:nil];
CMTime duration = sourceAsset.duration;
NSInteger seconds = (int)CMTimeGetSeconds(duration);
NSDate* date = [NSDate dateWithTimeIntervalSince1970:seconds];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]];
if (seconds >= 360) {
[dateFormatter setDateFormat:@"HH:mm:ss"];
} else{
[dateFormatter setDateFormat:@"mm:ss"];
}
NSString* result = [dateFormatter stringFromDate:date];
return result;
}