华为云会议 MEETING-场景5:创建会议:示例代码

时间:2024-10-28 14:49:34

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/// 创建会议
- (void)creatMeeting {
    HWMCreateConfParam *param = [[HWMCreateConfParam alloc] init];
    param.subject = @"会议标题";
    param.confType = HWMConfTypeVideoData;
    param.needPassword = YES;// 会议是否需要设置密码,默认不需要
    param.isCameraOn = YES;// 是否打开摄像头, 默认关闭
    param.isMicOn = YES;// 是否打开麦克风, 默认打开
    param.isRecordOn = NO;// 是否打开会议录制, 默认关闭
    param.joinConfRestrictionType = HWMJoinConfRestrictionAll;// 允许入会范围
    // 与会者列表
    if (self.selectedMemebrs) {
        __block NSMutableArray *members = [[NSMutableArray alloc] init];
        [self.selectedMemebrs enumerateObjectsUsingBlock:^(HWMContactSelectedModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            HWMCreateConfMember *member = [[HWMCreateConfMember alloc] init];
            member.accountId = obj.accountId;
            member.number = obj.number;
            member.name = obj.name;
            member.thirdUserId = obj.thirdUserId;
            [members addObject:member];
        }];
        param.members = members;
    }
    [[HWMSdk getOpenApi] createConf:param callback:^(NSError * _Nullable error, HWMCreateConfResult * _Nullable result) {
        [self hideLoading];
        if (error) {
            NSLog(@"创会失败%@", error.localizedDescription);
        }else{
            NSLog(@"创会成功");
        }
    }];
}

与会者列表可以携带与会者创建会议,创建会议成功后服务端会呼叫携带的与会人入会,不需要可以不传。

support.huaweicloud.com/sdkreference-meeting/meeting_22_0161.html