更新时间:2024-06-28 GMT+08:00
分享

自定义与会者列表页面中的菜单

该接口用于自定义与会者列表页面中的菜单,包括下面三种菜单:

1.buildParticipantMoreMenuItems:自定义标题栏右侧菜单项

图1中区域1位置的菜单

2.buildParticipantItemMenuItems:自定义与会者列表项点击弹出的菜单

点击图1区域2弹出图2

3.buildParticipantToolbarMenuItems:自定义与会者页面底部菜单栏

图1中区域3位置的菜单

4.buildParticipantToolbarMoreMenuItems:自定义点击底部更多菜单项弹出的菜单

点击图1区域4弹出图3

使用场景

需要自定义与会者页面四个区域菜单项的场景

注意事项

1.SDK初始化的时候必须传入这个配置sdkConfig才会生效

自定义与会者列表点击菜单设置

示例代码

1
sdkConfig.setParticipantMenuStrategy(new CustomParticipantMenuHandle());

图1 与会者列表各个菜单区域图示

与会者列表自定义菜单

图2 与会者列表自定义菜单
图3 与会者列表更多自定义菜单

示例代码

 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
public class CustomParticipantMenuHandle implements IParticipentMenuStrategy {
    @Override
    public List<IConfMenu> buildParticipantMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ParticipantShareMenu());
        confMenus.add(new ContantMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildParticipantItemMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        
        confMenus.add(new MuteOrUnmuteMenu());
        confMenus.add(new CameraMenu());
        confMenus.add(new HandsUpOrDownMenu().setDarkIcon(true));
        confMenus.add(new SelectWatchOrCacnelMenu());
        confMenus.add(new PrivateChatMenu());
        confMenus.add(new BroastAndCacelMenu());
        
        confMenus.add(new RenameMenu());
        confMenus.add(new InviteOrCancelShareMenu());
        confMenus.add(new GrantOrCancelLocalRecordMenu());
        confMenus.add(new SetAttendeeMenu());
        confMenus.add(new ReleaseOrRequestChairManMenu());
        confMenus.add(new SetChairmanMenu());
        confMenus.add(new SetOrCancelCoHostMenu());
        confMenus.add(new MoveToWaitingRoomMenu()); 
        confMenus.add(new RecallMenu());
        if (HWMBizSdk.getPublicConfigApi().isChinaSite()) {
            confMenus.add(new CallOtherNumberMenu());
        }
        
        confMenus.add(new HangupMenu());
        confMenus.add(new AdmitMenu());
        confMenus.add(new AutoAdmitMenu());
        confMenus.add(new RemoveMenu());

        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildParticipantToolbarMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        //--------------主持人身份下才有的菜单-------------
        confMenus.add(new MuteAllMenu());
        confMenus.add(new CancelAllMuteMenu());
        confMenus.add(new MoreMenu());
        //--------------非主持人身份下才有的菜单-------------
        confMenus.add(new HandsupMenu());
        confMenus.add(new HandsDownMenu());
        confMenus.add(new RequestChairmanMenu());
        //-----------演示增加自定义菜单----------
        confMenus.add(new CustomMenu());
        return null;
    }
    @Override
    public List<IConfMenu> buildParticipantToolbarMoreMenuItems() {
	List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ReleaseOrRequestChairManMenu());
        confMenus.add(new AllowUnmuteOrNotMenu());
        confMenus.add(new LockOrUnlockConfMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMoreMenu());
        return confMenus;
    }
}

相关文档