Updated on 2023-03-23 GMT+08:00

Creating a Meeting

1
HWMSdk.getOpenApi.createConf(CreateConfParam, HwmCancelableCallBack)

API Description

This API is used to create an instant meeting and join the meeting immediately.

Precautions

This API applies for the audio and camera permissions of the application.

Method Definition

1
2
3
4
5
6
 /**
     * Creates a meeting.
     * @param createConfParam Indicates the createConfParam object.
     * @param hwmCallback Indicates the result callback.
     */
   void createConf(CreateConfParam createConfParam , HwmCancelableCallBack <ConfInfo> hwmCallback);

Parameter Description

Table 1 Parameter description

Parameter

Mandatory

Type

Description

createConfParam

Yes

CreateConfParam

createConfParam object.

hwmCallback

Yes

HwmCancelableCallBack

Callback object.

Return Values

None

Parameter Extension

Table 2 CreateConfParam parameters

Parameter

Mandatory

Type

Description

setSubject

Yes

String

Meeting topic.

setConfType

Yes

ConfType

CONF_AUDIO(0, "Voice meeting"),

CONF_VIDEO(1, "Video meeting"),

setNeedPassword

Yes

boolean

Whether a password is required.

NOTE:

This parameter is valid only for meetings with a random ID.

guestPwd

No

String

Guest password. If this parameter is left blank, the guest password is generated by the server.

NOTE:

This parameter is valid only for meetings with a random ID.

setAttendeeMembers

No

List<AttendeeModel>

Participant list.

setCameraOn

No

boolean

Whether to enable the camera.

setMicOn

No

boolean

Whether to enable the microphone.

setRecordOn

No

boolean

Whether to enable meeting recording.

NOTE:

This parameter is valid only for cloud recording, not for local recording on clients.

setAutoRecord

No

boolean

Whether to automatically start recording after the meeting starts. The default value is false. Meeting recording must be enabled if automatic recording is enabled.

NOTE:

This parameter is valid only for cloud recording, not for local recording on clients.

setVmrId

No

String

Cloud meeting room ID.

setJoinConfRestrictionType

No

JoinConfPermissionType

PERMIT_EVERYONE("PERMIT_EVERYONE", 0, "Everyone can join the meeting.")

PERMIT_ENTERPRISE_USER(The "PERMIT_ENTERPRISE_USER", 2, "Only corporate users are allowed to join the meeting.")

PERMIT_INVITED_USER("PERMIT_INVITED_USER", 3, "Only invited users are allowed to join the meeting.");

Sample Code

 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
    List<AttendeeModel> attendeeList = new ArrayList<>();
        // The following three methods are available:
	    String name = "huawei123456";
       	    String number = "+99123456xxx";
	    String thirdAccountId = "123456abcd";
            if (!TextUtils.isEmpty(thirdAccount)) {
                if (LoginStatusCache.getsLoginAccountInfo() instanceof AppIdAuthParam) {
                    // An app ID is used for login.
                    attendeeList.add(AttendeeModel.buildAttendeeByThirdAccountId(thirdAccount,name));
                }
            } else if(number.startsWith("+99")){
                // A SIP number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeBySipNumber(number, name));
            } else {
                // A mobile number or a fixed-line phone number is used to join the meeting.
                attendeeList.add(AttendeeModel.buildAttendeeByPhone(number, name));
            }

CreateConfParam createConfParam = new CreateConfParam()                             
     .setSubject("huawei123456's meeting")                             // Set the meeting topic.
     .setConfType(ConfType.CONF_AUDIO)                        // Set the meeting type.
     .setVmrId(2c9183e07562e60b0175647ea92f59b3)         // (Optional) Set the cloud meeting room ID.
     .setJoinConfRestrictionType(JoinConfPermissionType.PERMIT_EVERYONE)   // Specify the scope of users who are allowed to join the meeting.
     .setNeedPassword(true)                  // Specify whether to create a password.
     .setCameraOn(true)           // Specify whether to enable the camera.
     .setMicOn(true)              // Specify whether to enable the microphone.
     .setRecordOn(true)    // Specify whether to enable meeting recording.
     .setAttendeeMembers(attendeeList);    // Add participant information.

HWMSdk.getOpenApi(getActivity()).createConf(createConfParam, new HwmCancelableCallBack<ConfInfo>() {  

     // Callback invoked when a meeting is created.
     @Override              
     public void onSuccess(ConfInfo confInfo) {                    
         Log.i(TAG, "Meeting created: Meeting ID: "+ confInfo.getConfId() +
              ";Meeting password:" + confInfo.getConfPwd());              
     }
         
     // Callback invoked when a meeting fails to be created.
     @Override              
     public void onFailed(int retCode, String desc) {                             
         dismissLoading();                   
         String err = ErrorMessageFactory.create(Utils.getApp(), retCode);                   
         if (TextUtils.isEmpty(err)) {                       
            err = Utils.getApp().getString(com.huawei.hwmmobileconfui.R.string.conf_create_error);                   
         }                  
         Log.e(TAG, "Failed to create the meeting: "+ err);
     }         
    @Override
    public void onCancel() {
        
    }
});