|
|
@@ -573,7 +573,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-- (void)setWebRctMsgBydelayed:(NSInteger)delayedMS withPacketLoss:(NSString*)PacketLossStr withSpeed:(NSString*)speedStr withFPS:(NSString*)fpsStr
|
|
|
+- (void)setWebRctMsgBydelayed:(NSInteger)delayedMS withPacketLoss:(NSInteger)PacketLoss withSpeed:(NSString*)speedStr withFPS:(NSString*)fpsStr
|
|
|
{
|
|
|
//网络延迟: [0, 50ms)= 绿色 #22A082 ,[50ms, 100ms= 黄色, [100ms, ∞)= 红色 #FF2855
|
|
|
|
|
|
@@ -595,11 +595,18 @@
|
|
|
}
|
|
|
|
|
|
NSString*LossleftStr = NSLocalizedString(@"webrtc_msg_PacketLoss",nil);
|
|
|
- NSString*LossRightStr = PacketLossStr;
|
|
|
+ NSString*LossRightStr = [[NSString alloc] initWithFormat:@"%ld%%",PacketLoss];
|
|
|
NSString *LossfullTitle = [[NSString alloc] initWithFormat:@"%@%@",LossleftStr,LossRightStr];
|
|
|
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:LossfullTitle];
|
|
|
NSRange rightRange = NSMakeRange([LossfullTitle rangeOfString:LossRightStr].location, LossRightStr.length);
|
|
|
- UIColor *rightColor =[UIColor hwColor:@"#FF2855" alpha:1.0];
|
|
|
+ UIColor *rightColor = [UIColor hwColor:@"22A082"];
|
|
|
+ if(PacketLoss >= 5 && PacketLoss < 10){
|
|
|
+ rightColor = [UIColor yellowColor];
|
|
|
+ }
|
|
|
+ else if(PacketLoss >= 10){
|
|
|
+ rightColor = [UIColor hwColor:@"#FF2855"];
|
|
|
+ }
|
|
|
+
|
|
|
[attrStr addAttribute:NSForegroundColorAttributeName value:rightColor range:rightRange];
|
|
|
_PacketLossLabel.attributedText = attrStr;
|
|
|
|