萤石云 iOSSDK,移植跨平台相关工程
JLChen
2021-07-21 6b58ff6be1b45ed911b00aff680eaecb0fc73fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//
//  EZHubDebugViewController.m
//  EZOpenSDKDemo
//
//  Created by yuqian on 2020/5/18.
//  Copyright © 2020 hikvision. All rights reserved.
//
 
#import "EZHubDebugViewController.h"
#import "EZPlaybackViewController.h"
#import "EZLivePlayViewController.h"
 
@interface EZHubDebugViewController ()
@property (weak, nonatomic) IBOutlet UITextField *deviceSerial;
@property (weak, nonatomic) IBOutlet UITextField *channelNo;
@property (weak, nonatomic) IBOutlet UIButton *nextBtn;
 
@end
 
@implementation EZHubDebugViewController
 
- (void)viewDidLoad {
    [super viewDidLoad];
//    self.deviceSerial.text = [NSString stringWithFormat:@"%@-test123123", _deviceInfo.deviceSerial];
    self.deviceSerial.text = [NSString stringWithFormat:@"ZPFTESTCAS1:test011-test123123"];
}
 
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
    switch (_playType) {
        case 1:
            [self.nextBtn setTitle:@"跳转进行预览" forState:UIControlStateNormal];
            break;
        case 2:
            [self.nextBtn setTitle:@"跳转进行回放" forState:UIControlStateNormal];
            break;
        default:
            break;
    }
}
 
- (IBAction)clickNextBtn:(id)sender {
    
    switch (_playType) {
        case 1:
        {
            EZLivePlayViewController *vc = [[UIStoryboard storyboardWithName:@"EZMain" bundle:nil] instantiateViewControllerWithIdentifier:@"EZLivePlayViewController"];
            vc.deviceInfo = _deviceInfo;
            vc.hubCoDevSerial = self.deviceSerial.text;
            vc.cameraIndex = [self.channelNo.text intValue];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        case 2:
        {
            EZPlaybackViewController *vc = [[UIStoryboard storyboardWithName:@"EZMain" bundle:nil] instantiateViewControllerWithIdentifier:@"EZPlaybackViewController"];
            vc.deviceInfo = _deviceInfo;
            vc.hubCoDevSerial = self.deviceSerial.text;
            vc.cameraIndex = [self.channelNo.text intValue];
            [self.navigationController pushViewController:vc animated:YES];
        }
            break;
        default:
            break;
    }
}
 
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [[UIApplication sharedApplication] sendAction:@selector(resignFirstResponder) to:nil from:nil forEvent:nil];
}
 
@end