From 4c1abca185a5727da6fb314a0cb4cd44bfe1b3bf Mon Sep 17 00:00:00 2001 From: Davin <591807572@qq.com> Date: 星期五, 07 六月 2024 17:48:47 +0800 Subject: [PATCH] feature appkey修改 --- EZSDK/EZSDK/EZSDK.m | 84 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 73 insertions(+), 11 deletions(-) diff --git a/EZSDK/EZSDK/EZSDK.m b/EZSDK/EZSDK/EZSDK.m index d7c2c54..b9b1725 100644 --- a/EZSDK/EZSDK/EZSDK.m +++ b/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(@"娴峰鐗坘ey--%@",globalAppKey); + HDLEZLog(@"娴峰鐗坘ey--%@",globalAppKey); }else{ isHavelibInit = [EZOpenSDK initLibWithAppKey:appKey]; [[GlobalKit shareKit] setHdlAppKey:appKey]; - NSLog(@"鍥藉唴鐗坘ey--%@", appKey); + HDLEZLog(@"鍥藉唴鐗坘ey--%@", 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,10 +200,27 @@ 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]; - - +} + +/** + 鏌ョ湅瑙嗛鐩戞帶鐩存挱 + @param deviceInfo 璁惧淇℃伅 + @param msgId 娑堟伅Id + @param isShow 鏄惁灞曠ず鍛煎彨寮规 + */ +- (void)Play:(EZDeviceInfo*)deviceInfo messageId:(NSString *)msgId showCallout:(BOOL)isShow { + [GlobalKit shareKit].deviceType=HDLEZDeviceType_Default; + UIStoryboard *addDeviceStoryBoard = [UIStoryboard storyboardWithName:@"EZMain" bundle:nil]; + EZLivePlayViewController *rootViewController = [addDeviceStoryBoard instantiateViewControllerWithIdentifier:@"EZLivePlayViewController"]; + rootViewController.isShowAlert = isShow; + rootViewController.deviceInfo=(EZDeviceInfo *)deviceInfo; + rootViewController.msgId = msgId; + NSLog(@"play--iphone--deviceName -%@",rootViewController.deviceInfo.deviceName); + + [[self getCurrentVC].navigationBar setHidden:NO]; + [[self getCurrentVC] pushViewController:rootViewController animated:YES]; } /// 鎸囧畾搴忓垪鍙锋挱鏀� @@ -220,6 +239,22 @@ }]; } +/// 鎸囧畾搴忓垪鍙� 鏌ョ湅瑙嗛鐩戞帶鐩存挱(鐚溂鍛煎彨鍔熻兘) +/// @param deviceSerial 搴忓垪鍙� +- (void)PlayWithDeviceSerial:(NSString *)deviceSerial msgId:(NSString *)msgId { + //鑾峰彇璁惧鍒楄〃鎺ュ彛 + [EZOpenSDK getDeviceInfo:deviceSerial completion:^(EZDeviceInfo *deviceInfo, NSError *error) { + if(error) + { + NSLog(@"EZ 鏌ヨ璁惧淇℃伅澶辫触"); + return; + } + if (deviceInfo) { + [self Play:deviceInfo messageId:msgId showCallout:YES]; + } + }]; +} + /** 鏍规嵁搴忓垪鍙疯繘鍏ラ棬閿佽棰� @param deviceSerial 搴忓垪鍙� @@ -227,12 +262,35 @@ @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; + vc.isVideoDoorLock = [deviceType isEqualToString:HDLEZ_DOOR_SPK]; [[self getCurrentVC] setNavigationBarHidden:NO]; + [[self getCurrentVC].navigationBar setHidden:NO]; + [[self getCurrentVC] pushViewController:vc animated:YES]; +} + +-(void)PlayWithDeviceSerial:(NSString *)deviceSerial deviceId:(NSString*)deviceId deviceType:(NSString *)deviceType msgId:(NSString *)msgId { + 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; + vc.isShowAlert = YES; + vc.msgId = msgId; + + vc.isVideoDoorLock = [deviceType isEqualToString:HDLEZ_DOOR_SPK]; + [[self getCurrentVC] setNavigationBarHidden:NO]; + [[self getCurrentVC].navigationBar setHidden:NO]; [[self getCurrentVC] pushViewController:vc animated:YES]; } @@ -245,6 +303,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 +316,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 +326,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 +337,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]; } -- Gitblit v1.8.0