| | |
| | | |
| | | #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" |
| | |
| | | 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]; |
| | |
| | | instanceVC.filterTypes=filterTepes; |
| | | //push摄像头列表的viewController |
| | | [[self getCurrentVC] setNavigationBarHidden:NO]; |
| | | // [[self getCurrentVC].navigationBar setHidden:NO]; |
| | | [[self getCurrentVC] pushViewController:instanceVC animated:YES]; |
| | | } |
| | | |
| | |
| | | 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以下扫码功能请自行实现"]; |
| | |
| | | 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]; |
| | | } |
| | | |
| | | /// 指定序列号播放 |
| | |
| | | }]; |
| | | } |
| | | |
| | | /// 指定序列号 查看视频监控直播(猫眼呼叫功能) |
| | | /// @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 序列号 |
| | |
| | | @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]; |
| | | } |
| | | |
| | |
| | | EZSettingViewController *settingVC=[settingStoryBoard instantiateViewControllerWithIdentifier:@"EZSettingViewController"]; |
| | | settingVC.deviceInfo=(EZDeviceInfo *)deviceInfo; |
| | | [[self getCurrentVC] setNavigationBarHidden:NO]; |
| | | [[self getCurrentVC].navigationBar setHidden:NO]; |
| | | [[self getCurrentVC] pushViewController:settingVC animated:YES]; |
| | | } |
| | | |
| | |
| | | EZPlaybackViewController *playBackVC=[playBackStoryBoard instantiateViewControllerWithIdentifier:@"EZPlaybackViewController"]; |
| | | playBackVC.deviceInfo=(EZDeviceInfo *)deviceInfo; |
| | | [[self getCurrentVC] setNavigationBarHidden:NO]; |
| | | [[self getCurrentVC].navigationBar setHidden:NO]; |
| | | [[self getCurrentVC] pushViewController:playBackVC animated:YES]; |
| | | } |
| | | |
| | |
| | | - (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]; |
| | | } |
| | | |
| | |
| | | - (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]; |
| | | |
| | | } |