萤石云 iOSSDK,移植跨平台相关工程
chenqiyang
2023-06-05 cf977559d6821a1ccce2acae076835a8037f2a90
EZSDK/EZSDK/EZSDK.m
@@ -7,17 +7,17 @@
#import "EZSDK.h"
//#import "DeviceInfo.h"
#import "EZDeviceInfo.h"
#import "EZOpenSDK.h"
#import <EZOpenSDKFramework/EZDeviceInfo.h>
#import <EZOpenSDKFramework/EZOpenSDK.h>
#import "GlobalKit.h"
#import "EZAccessToken.h"
#import <EZOpenSDKFramework/EZAccessToken.h>
#import "NSArray+DDKit.h"
#import "EZAddByQRCodeViewController.h"
#import "EZLivePlayViewController.h"
#import "EZSettingViewController.h"
#import "EZPlaybackViewController.h"
#import "EZDeviceTableViewController.h"
#import "EZHCNetDeviceSDK.h"
#import <EZOpenSDKFramework/EZHCNetDeviceSDK.h>
#import "EZMessagePhotoViewController.h"
#import "HDLEZVisitorRecordViewController.h"
#import "HDLEZDeviceMsgListViewController.h"
@@ -51,11 +51,11 @@
        if (!LanguageIsChinese) {
            //海外版
            isHavelibInit = [EZGlobalSDK initLibWithAppKey:globalAppKey];
            NSLog(@"海外版key--%@",globalAppKey);
            HDLEZLog(@"海外版key--%@",globalAppKey);
        }else{
            isHavelibInit = [EZOpenSDK initLibWithAppKey:appKey];
            [[GlobalKit shareKit] setHdlAppKey:appKey];
            NSLog(@"国内版key--%@", appKey);
            HDLEZLog(@"国内版key--%@", appKey);
        }
        [EZHCNetDeviceSDK initSDK];
        [EZOPENSDK enableP2P:YES];
@@ -146,6 +146,7 @@
    instanceVC.filterTypes=filterTepes;
    //push摄像头列表的viewController
    [[self getCurrentVC] setNavigationBarHidden:NO];
//    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:instanceVC animated:YES];
}
@@ -179,6 +180,7 @@
        EZAddByQRCodeViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"AddByQRCode"];
        rootViewController.deviceType=type;
        [[self getCurrentVC] setNavigationBarHidden:NO];
        [[self getCurrentVC].navigationBar setHidden:NO];
        [[self getCurrentVC] pushViewController:rootViewController animated:YES];
    } else {
        //        [UIView dd_showMessage:@"iOS 7.0以下扫码功能请自行实现"];
@@ -198,7 +200,7 @@
    rootViewController.deviceInfo=(EZDeviceInfo *)deviceInfo;
    NSLog(@"play--iphone--deviceName -%@",rootViewController.deviceInfo.deviceName);
//            rootViewController.cameraIndex=0;
    [[self getCurrentVC] setNavigationBarHidden:NO];
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:rootViewController animated:YES];
    
    
@@ -227,12 +229,16 @@
 @param deviceType 设备spk(用于区分是否为门锁)
 */
-(void)PlayWithDeviceSerial:(NSString *)deviceSerial deviceId:(NSString*)deviceId deviceType:(NSString *)deviceType{
    if ([[self getCurrentVC] isKindOfClass:[EZLivePlayViewController class]]) {//防止重复进入
        return;
    }
    [GlobalKit shareKit].deviceType=[deviceType isEqualToString:HDLEZ_DOOR_SPK] ? HDLEZDeviceType_Door : HDLEZDeviceType_Default;
    UIStoryboard *ezMainStoryBoard = [UIStoryboard storyboardWithName:@"EZMain" bundle:nil];
    EZLivePlayViewController *vc = [ezMainStoryBoard instantiateViewControllerWithIdentifier:@"EZLivePlayViewController"];
    vc.deviceId=deviceId;
    vc.deviceSerial=deviceSerial;
    [[self getCurrentVC] setNavigationBarHidden:NO];
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:vc animated:YES];
}
@@ -245,6 +251,7 @@
    EZSettingViewController *settingVC=[settingStoryBoard instantiateViewControllerWithIdentifier:@"EZSettingViewController"];
    settingVC.deviceInfo=(EZDeviceInfo *)deviceInfo;
    [[self getCurrentVC] setNavigationBarHidden:NO];
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:settingVC animated:YES];
}
@@ -257,6 +264,7 @@
    EZPlaybackViewController *playBackVC=[playBackStoryBoard instantiateViewControllerWithIdentifier:@"EZPlaybackViewController"];
    playBackVC.deviceInfo=(EZDeviceInfo *)deviceInfo;
    [[self getCurrentVC] setNavigationBarHidden:NO];
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:playBackVC animated:YES];
}
@@ -266,7 +274,8 @@
- (void)toTemPassView:(NSString*)deviceId{
    HDLEZVisitorRecordViewController *vc=[[HDLEZVisitorRecordViewController alloc] init];
    vc.deviceId=deviceId;
    [[self getCurrentVC] setNavigationBarHidden:YES];
//    [[self getCurrentVC] setNavigationBarHidden:YES];
    [[self getCurrentVC].navigationBar setHidden:YES];
    [[self getCurrentVC] pushViewController:vc animated:YES];
}
@@ -276,7 +285,8 @@
- (void)toDeviceMsgListView:(NSString*)deviceId{
    HDLEZDeviceMsgListViewController *vc=[[HDLEZDeviceMsgListViewController alloc] init];
    vc.deviceId=deviceId;
    [[self getCurrentVC] setNavigationBarHidden:YES];
//    [[self getCurrentVC] setNavigationBarHidden:YES];
    [[self getCurrentVC].navigationBar setHidden:YES];
    [[self getCurrentVC] pushViewController:vc animated:YES];
}