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 |   56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/EZSDK/EZSDK/EZSDK.m b/EZSDK/EZSDK/EZSDK.m
index ae54994..b9b1725 100644
--- a/EZSDK/EZSDK/EZSDK.m
+++ b/EZSDK/EZSDK/EZSDK.m
@@ -202,8 +202,25 @@
 //            rootViewController.cameraIndex=0;
     [[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];
 }
 
 /// 鎸囧畾搴忓垪鍙锋挱鏀�
@@ -218,6 +235,22 @@
         }
         if (deviceInfo) {
             [self Play:deviceInfo];
+        }
+    }];
+}
+
+/// 鎸囧畾搴忓垪鍙� 鏌ョ湅瑙嗛鐩戞帶鐩存挱(鐚溂鍛煎彨鍔熻兘)
+/// @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];
         }
     }];
 }
@@ -237,6 +270,25 @@
     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];

--
Gitblit v1.8.0