bug修复

This commit is contained in:
kai60 2020-10-21 22:36:48 +08:00
parent 1055f7ddd7
commit 0ece8602fb
8 changed files with 137 additions and 26 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -15777,7 +15777,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = WFX8GD5HFX; DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;
@ -15895,7 +15895,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = WFX8GD5HFX; DEVELOPMENT_TEAM = WFX8GD5HFX;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
ENABLE_TESTABILITY = YES; ENABLE_TESTABILITY = YES;

View File

@ -159,4 +159,6 @@ typedef enum{
+ (NSString *)getRandomStringWithNum:(NSInteger)num; + (NSString *)getRandomStringWithNum:(NSInteger)num;
CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float centerY ,float x ,float y ,float angle); CGAffineTransform GetCGAffineTransformRotateAroundPoint(float centerX, float centerY ,float x ,float y ,float angle);
+ (void)interfaceOrientation:(UIInterfaceOrientation)orientation;
+ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor;
@end @end

View File

@ -287,6 +287,31 @@
return timeString; return timeString;
} }
+ (void)interfaceOrientation:(UIInterfaceOrientation)orientation
{
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
SEL selector = NSSelectorFromString(@"setOrientation:");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIDevice currentDevice]];
int val = orientation;
// 20 1 selectortarget
[invocation setArgument:&val atIndex:2];
[invocation invoke];
}
}
+ (UIBarButtonItem*)ItemWithTitle:(NSString *)title target:(id)target action:(SEL)action titleColor:(UIColor*)titleColor
{
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
if(title.length) [button setTitle:title forState:UIControlStateNormal];
button.titleLabel.font = [UIFont systemFontOfSize:16];
if (titleColor==nil) titleColor = [UIColor whiteColor];
[button setTitleColor:titleColor forState:UIControlStateNormal];
[button setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
[button sizeToFit];
[button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
return [[UIBarButtonItem alloc] initWithCustomView:button];
}
+ (NSDictionary *)getSSIDInfo + (NSDictionary *)getSSIDInfo
{ {
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces()); NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());

View File

@ -131,15 +131,6 @@
// //
#ifdef IOS6 #ifdef IOS6
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations { - (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeRight; return UIInterfaceOrientationMaskLandscapeRight;
} }

View File

@ -28,20 +28,21 @@
NSString*start=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; NSString*start=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyyMMddHHmm"; formatter.dateFormat = @"yyyyMMddHHmmss";
NSDate*date=[formatter dateFromString:start]; NSDate*date=model.date;
if (!date
) {
date= [formatter dateFromString:[start stringByAppendingFormat:@"%02ld",model.second]];
}
NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute]; NSString*end=[NSString stringWithFormat:@"%ld%02ld%02ld%02ld%02ld",model.year,model.month,model.day,model.hour,model.minute];
if (date) if (date)
{ {
if ([model.cType isEqualToString:@"S"])
{ date=[date dateByAddingTimeInterval:model.time];
date=[date dateByAddingTimeInterval:model.time];
} formatter.dateFormat=@"yyyyMMddHHmm";
else
{
date=[date dateByAddingTimeInterval:model.time*60];
}
end=[formatter stringFromDate:date]; end=[formatter stringFromDate:date];
} }
else else

View File

@ -17,17 +17,29 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; self.navigationController.navigationBar.hidden=YES;
// formatter.dateFormat = @"yyyy-MM-dd HH:mm"; [[UIApplication sharedApplication] setStatusBarHidden:YES];
// [AppDelegate sharedDefault].canFullScreen = YES;
// NSString *string = [formatter stringFromDate:self.model.date]; //
[self setTitleString:@"视频回放"]; [self setTitleString:@"视频回放"];
UIBarButtonItem*bat=[CommonUtils ItemWithTitle:@"切换" target:self action:@selector(varyOritation) titleColor:[UIColor whiteColor]];
self.navigationItem.rightBarButtonItems=nil;
self.navigationItem.rightBarButtonItem=bat;
self.view.backgroundColor=[UIColor blackColor]; self.view.backgroundColor=[UIColor blackColor];
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(taptochange)];
[self.view addGestureRecognizer:tap];
[CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight];
[self connectDevice]; [self connectDevice];
// Do any additional setup after loading the view from its nib. // Do any additional setup after loading the view from its nib.
} }
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
}
-(void)playFiles -(void)playFiles
{ {
//VC //VC
@ -37,6 +49,7 @@
self.player.mute = YES; self.player.mute = YES;
self.player.delegate=self; self.player.delegate=self;
self.player.viewController.view.backgroundColor = [UIColor clearColor]; self.player.viewController.view.backgroundColor = [UIColor clearColor];
self.player.viewController.view.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.player.viewController.view.frame=self.playView.bounds; self.player.viewController.view.frame=self.playView.bounds;
[self addChildViewController:self.player.viewController]; [self addChildViewController:self.player.viewController];
@ -54,6 +67,11 @@
[weakSelf.view makeToast:@"连接失败请重试!"]; [weakSelf.view makeToast:@"连接失败请重试!"];
weakSelf.retryBtn.hidden=NO; weakSelf.retryBtn.hidden=NO;
[AppDelegate sharedDefault].canFullScreen = NO;
[CommonUtils interfaceOrientation:UIDeviceOrientationPortrait];
}); });
@ -119,5 +137,79 @@
self.player=nil; self.player=nil;
[self connectDevice]; [self connectDevice];
} }
-(void)taptochange
{
self.navigationController.navigationBar.hidden=!self.navigationController.navigationBar.hidden;
[[UIApplication sharedApplication] setStatusBarHidden:self.navigationController.navigationBar.isHidden];
}
-(void)dealloc
{
self.navigationController.navigationBar.hidden=NO;
[[UIApplication sharedApplication] setStatusBarHidden:NO];
[AppDelegate sharedDefault].canFullScreen = NO;
[CommonUtils interfaceOrientation:UIInterfaceOrientationPortrait];
}
-(UIInterfaceOrientationMask)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAll;
}
#pragma mark
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{
return UIDeviceOrientationLandscapeRight;
}
#pragma mark -
-(void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
if (toInterfaceOrientation == UIInterfaceOrientationPortrait)
{
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) {
}
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
{
}
}
-(BOOL)shouldAutorotate
{
return YES;;
}
-(BOOL)prefersStatusBarHidden
{
return self.navigationController.isNavigationBarHidden;
}
-(void)varyOritation
{
UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;
if (statusBarOrientation==UIInterfaceOrientationPortrait)
{
[AppDelegate sharedDefault].canFullScreen = YES;
[CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight];
}
else
{
[AppDelegate sharedDefault].canFullScreen = NO;
[CommonUtils interfaceOrientation:UIDeviceOrientationPortrait];
}
}
@end @end

View File

@ -36,7 +36,7 @@
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/> <fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="重试"> <state key="normal" title="重试">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>
<connections> <connections>
<action selector="retry:" destination="-1" eventType="touchUpInside" id="Wcp-lZ-BMl"/> <action selector="retry:" destination="-1" eventType="touchUpInside" id="Wcp-lZ-BMl"/>