Files
SellyCloudSDK_demo/Example/SellyCloudSDK/Play/AVLiveStreamModel.m
2026-04-07 18:20:16 +08:00

36 lines
858 B
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
//
// AVLiveStreamModel.m
// AVDemo
//
#import "AVLiveStreamModel.h"
@implementation AVLiveStreamModel
+ (NSDictionary *)modelCustomPropertyMapper {
return @{
@"xorKey" : @"xor_key"
};
}
- (NSString *)displayName {
return self.stream.length > 0 ? self.stream : @"未知流";
}
- (NSString *)durationString {
NSInteger totalSeconds = (NSInteger)self.duration;
NSInteger hours = totalSeconds / 3600;
NSInteger minutes = (totalSeconds % 3600) / 60;
NSInteger seconds = totalSeconds % 60;
if (hours > 0) {
// 大于1小时显示 hh:mm:ss
return [NSString stringWithFormat:@"%02ld:%02ld:%02ld", (long)hours, (long)minutes, (long)seconds];
} else {
// 1小时内显示 mm:ss
return [NSString stringWithFormat:@"%02ld:%02ld", (long)minutes, (long)seconds];
}
}
@end