萤石云 iOSSDK,移植跨平台相关工程
Davin
2023-07-10 0de4cf306d8e13fd57b3e04bfb81362a10f12a4d
EZSDK/EZSDK/EZSDK.m
@@ -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];
@@ -202,8 +202,18 @@
//            rootViewController.cameraIndex=0;
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:rootViewController animated:YES];
}
- (void)Play:(EZDeviceInfo*)deviceInfo 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;
    NSLog(@"play--iphone--deviceName -%@",rootViewController.deviceInfo.deviceName);
    [[self getCurrentVC].navigationBar setHidden:NO];
    [[self getCurrentVC] pushViewController:rootViewController animated:YES];
}
/// 指定序列号播放
@@ -229,11 +239,15 @@
 @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];