bug修复
This commit is contained in:
+11
-10
@@ -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
|
||||
|
||||
+96
-4
@@ -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
|
||||
|
||||
+1
-1
@@ -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"/>
|
||||
|
||||
Reference in New Issue
Block a user