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

Scenario 7: Joining a Meeting

Description

You can join a meeting using the meeting ID and password regardless of whether you have logged in.

Service Process

  1. Call the API.

    1. Create a JoinConfParam object.
      1. PasswordJoinConfParam is used to join a meeting based on the meeting ID.
      2. RandomJoinConfParam is used to join a meeting in random mode.
      1
      2
      3
      4
      5
      6
      7
      // Create a JoinConfParam object.
      PasswordJoinConfParam passwordJoinConfParam = new PasswordJoinConfParam()                 
          .setConfId("987654321")            // Set the meeting ID.
          .setNickname("huawei123456")     // Set the nickname.
          .setCameraOn(true)         // Specify whether to enable the camera.
          .setMicOn(true);           // Specify whether to enable the microphone.
          .setPassword(true)     // Set the password for joining the meeting.
      
    2. Call the joinConf API to join the meeting. The data in the preceding step is used as input parameters.

  2. Implement the callback.

    Process the result in the callback.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
// Join a meeting.
HWMSdk.getOpenApi(getActivity()).joinConf(passwordJoinConfParam, new HwmCancelableCallBack<Void>() {             
    @Override             
    public void onSuccess(Void ret) {                 
         Log.i(TAG, "Meeting joined");
    }              
    @Override             
    public void onFailed(int retCode, String desc) {                 
         String err = ErrorMessageFactory.create(Utils.getApp(), retCode);                 
         if (TextUtils.isEmpty(err)) {                     
             err = Utils.getApp().getString(com.huawei.hwmmobileconfui.R.string.conf_join_fail_tip);                 
         }                
         Log.i(TAG, "Failed to join the meeting: "+ err);
    }         
    @Override
    public void onCancel() {
        Log.i(TAG, "Canceled the request to join the meeting");
    }
});

Precautions

If you call this API without logging in to HUAWEI CLOUD Meeting, the nickname parameter must be specified.