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

View File

@ -159,4 +159,6 @@ typedef enum{
+ (NSString *)getRandomStringWithNum:(NSInteger)num;
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

View File

@ -287,6 +287,31 @@
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
{
NSArray *interfaceNames = CFBridgingRelease(CNCopySupportedInterfaces());

View File

@ -131,15 +131,6 @@
//
#ifdef IOS6
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
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];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
formatter.dateFormat = @"yyyyMMddHHmm";
NSDate*date=[formatter dateFromString:start];
formatter.dateFormat = @"yyyyMMddHHmmss";
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];
if (date)
{
if ([model.cType isEqualToString:@"S"])
{
date=[date dateByAddingTimeInterval:model.time];
}
else
{
date=[date dateByAddingTimeInterval:model.time*60];
}
date=[date dateByAddingTimeInterval:model.time];
formatter.dateFormat=@"yyyyMMddHHmm";
end=[formatter stringFromDate:date];
}
else

View File

@ -17,17 +17,29 @@
- (void)viewDidLoad {
[super viewDidLoad];
// NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
// formatter.dateFormat = @"yyyy-MM-dd HH:mm";
//
// NSString *string = [formatter stringFromDate:self.model.date]; //
self.navigationController.navigationBar.hidden=YES;
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[AppDelegate sharedDefault].canFullScreen = YES;
[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];
UITapGestureRecognizer*tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(taptochange)];
[self.view addGestureRecognizer:tap];
[CommonUtils interfaceOrientation:UIDeviceOrientationLandscapeRight];
[self connectDevice];
// Do any additional setup after loading the view from its nib.
}
-(void)viewDidLayoutSubviews
{
[super viewDidLayoutSubviews];
}
-(void)playFiles
{
//VC
@ -37,6 +49,7 @@
self.player.mute = YES;
self.player.delegate=self;
self.player.viewController.view.backgroundColor = [UIColor clearColor];
self.player.viewController.view.autoresizingMask=UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
self.player.viewController.view.frame=self.playView.bounds;
[self addChildViewController:self.player.viewController];
@ -54,6 +67,11 @@
[weakSelf.view makeToast:@"连接失败请重试!"];
weakSelf.retryBtn.hidden=NO;
[AppDelegate sharedDefault].canFullScreen = NO;
[CommonUtils interfaceOrientation:UIDeviceOrientationPortrait];
});
@ -119,5 +137,79 @@
self.player=nil;
[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

View File

@ -36,7 +36,7 @@
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<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>
<connections>
<action selector="retry:" destination="-1" eventType="touchUpInside" id="Wcp-lZ-BMl"/>