萤石云 iOSSDK,移植跨平台相关工程
Davin
2024-12-18 a67450d72c47f400e56525125318ff1d6ca0a2e8
EZSDK/EZSDK/EZSDK.m
@@ -84,6 +84,16 @@
    [[GlobalKit shareKit] setHdlAccessToken:accessToken];
    [[GlobalKit shareKit] setHdlRefreshToken:refreshToken];
}
/**
 配置平台appkey和appSecret
 传入appKey和appSecret
 */
- (void)configHDLServerAppKey:(NSString *)appKey appSecret:(NSString *)appSecret {
    [[GlobalKit shareKit] setHdlServerAppKey:appKey];
    [[GlobalKit shareKit] setHdlServerAppSecret:appSecret];
}
/**
 设置SDK的河东接口的requestHttpsHost和平台 标识,1.on+(默认) 2.evoyo
 */
@@ -204,12 +214,19 @@
    [[self getCurrentVC] pushViewController:rootViewController animated:YES];
}
- (void)Play:(EZDeviceInfo*)deviceInfo showCallout:(BOOL)isShow {
/**
 查看视频监控直播
 @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];
@@ -232,6 +249,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 序列号
@@ -253,6 +286,24 @@
    [[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];
}
/**
 打开摄像头设置页面
 */