그룹 통화
This article introduces the use of the group call feature, such as initiating a group call and joining a group call.
Expected outcome
TUICallKit supports group calls. The expected outcome is shown in the figure below.
Initiate a group call | Receive a group call request | Accept group call requests |
| | |
Create groupID
Before using the group call feature, you need to create a group first and initiate a group call in an existing group.
Method one: Create a group by calling the Chat API, see Chat Group Management.
Method two: Create a group manually through the console, see Console group management.
Group call
Initiate a group call
Launch a group call using the groupCall API.
import com.tencent.qcloud.tuikit.tuicallengine.TUICallDefine import com.tencent.qcloud.tuikit.tuicallkit.TUICallKitTUICallKit.createInstance(context).groupCall("12345678", Arrays.asList("jane", "mike", "tommy"), TUICallDefine.MediaType.Video)
import com.tencent.qcloud.tuikit.tuicallengine.TUICallDefine; import com.tencent.qcloud.tuikit.tuicallkit.TUICallKit;TUICallKit.createInstance(context).groupCall("12345678", Arrays.asList("jane", "mike", "tommy"),TUICallDefine.MediaType.Video);
import TUICallKit_Swiftimport TUICallEngineTUICallKit.createInstance().groupCall(groupId: "12345678",userIdList: ["denny", "mike", "tommy"],callMediaType: .video)
#import <TUICallKit_Swift/TUICallKit_Swift-Swift.h>#import <TUICallEngine/TUICallEngine.h>[[TUICallKit createInstance] groupCallWithGroupId:@"12345678"userIdList:@[@"denny", @"mike", @"tommy"]callMediaType:TUICallMediaTypeVideo];
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';void groupCall() {TUICallKit.instance.groupCall('0001', ['denny', 'mike', 'tommy'], TUICallMediaType.video);}
Join a group call
Actively join an existing audio and video call in the group by calling the joinInGroupCall API.
import com.tencent.qcloud.tuikit.TUICommonDefineimport com.tencent.qcloud.tuikit.tuicallengine.TUICallDefine import com.tencent.qcloud.tuikit.tuicallkit.TUICallKitvar roomId = TUICommonDefine.RoomId()roomId.intRoomId = 123321var groupId = "12345678"TUICallKit.createInstance(context).joinInGroupCall(roomId, groupId, TUICallDefine.MediaType.Video)
import com.tencent.qcloud.tuikit.TUICommonDefine;import com.tencent.qcloud.tuikit.tuicallengine.TUICallDefine; import com.tencent.qcloud.tuikit.tuicallkit.TUICallKit;TUICommonDefine.RoomId roomId = new TUICommonDefine.RoomId();roomId.intRoomId = 123321;String groupId = "12345678";TUICallKit.createInstance(context).joinInGroupCall(roomId, groupId, TUICallDefine.MediaType.Video);
import TUICallKit_Swiftimport TUICallEnginelet roomId = TUIRoomId()roomId.intRoomId = 123321TUICallKit.createInstance().joinInGroupCall(roomId: roomId,groupId: "1234567",callMediaType: .video)
#import <TUICallKit/TUICallKit.h>#import <TUICallEngine/TUICallEngine.h>TUIRoomId *roomId = [[TUIRoomId alloc] init];roomId.intRoomId = 123321;[[TUICallKit createInstance] joinInGroupCallWithRoomId:roomIdgroupId:@"223344"callMediaType:TUICallMediaTypeVideo];
import 'package:tencent_calls_uikit/tencent_calls_uikit.dart';void joinInGroupCall() {TUIRoomId roomId = TUIRoomId();roomId.intRoomId = 123321;TUICallKit.instance.joinInGroupCall(roomId, '1234567', TUICallMediaType.video);}