计算
弹性云服务器 ECS
Flexus云服务
裸金属服务器 BMS
弹性伸缩 AS
镜像服务 IMS
专属主机 DeH
函数工作流 FunctionGraph
云手机服务器 CPH
Huawei Cloud EulerOS
网络
虚拟私有云 VPC
弹性公网IP EIP
虚拟专用网络 VPN
弹性负载均衡 ELB
NAT网关 NAT
云专线 DC
VPC终端节点 VPCEP
云连接 CC
企业路由器 ER
企业交换机 ESW
全球加速 GA
安全与合规
安全技术与应用
Web应用防火墙 WAF
企业主机安全 HSS
云防火墙 CFW
安全云脑 SecMaster
DDoS防护 AAD
数据加密服务 DEW
数据库安全服务 DBSS
云堡垒机 CBH
数据安全中心 DSC
云证书管理服务 CCM
边缘安全 EdgeSec
威胁检测服务 MTD
CDN与智能边缘
内容分发网络 CDN
CloudPond云服务
智能边缘云 IEC
迁移
主机迁移服务 SMS
对象存储迁移服务 OMS
云数据迁移 CDM
迁移中心 MGC
大数据
MapReduce服务 MRS
数据湖探索 DLI
表格存储服务 CloudTable
云搜索服务 CSS
数据接入服务 DIS
数据仓库服务 GaussDB(DWS)
数据治理中心 DataArts Studio
数据可视化 DLV
数据湖工厂 DLF
湖仓构建 LakeFormation
企业应用
云桌面 Workspace
应用与数据集成平台 ROMA Connect
云解析服务 DNS
专属云
专属计算集群 DCC
IoT物联网
IoT物联网
设备接入 IoTDA
智能边缘平台 IEF
用户服务
账号中心
费用中心
成本中心
资源中心
企业管理
工单管理
国际站常见问题
ICP备案
我的凭证
支持计划
客户运营能力
合作伙伴支持计划
专业服务
区块链
区块链服务 BCS
Web3节点引擎服务 NES
解决方案
SAP
高性能计算 HPC
视频
视频直播 Live
视频点播 VOD
媒体处理 MPC
实时音视频 SparkRTC
数字内容生产线 MetaStudio
存储
对象存储服务 OBS
云硬盘 EVS
云备份 CBR
存储容灾服务 SDRS
高性能弹性文件服务 SFS Turbo
弹性文件服务 SFS
云硬盘备份 VBS
云服务器备份 CSBS
数据快递服务 DES
专属分布式存储服务 DSS
容器
云容器引擎 CCE
容器镜像服务 SWR
应用服务网格 ASM
华为云UCS
云容器实例 CCI
管理与监管
云监控服务 CES
统一身份认证服务 IAM
资源编排服务 RFS
云审计服务 CTS
标签管理服务 TMS
云日志服务 LTS
配置审计 Config
资源访问管理 RAM
消息通知服务 SMN
应用运维管理 AOM
应用性能管理 APM
组织 Organizations
优化顾问 OA
IAM 身份中心
云运维中心 COC
资源治理中心 RGC
应用身份管理服务 OneAccess
数据库
云数据库 RDS
文档数据库服务 DDS
数据管理服务 DAS
数据复制服务 DRS
云数据库 GeminiDB
云数据库 GaussDB
分布式数据库中间件 DDM
数据库和应用迁移 UGO
云数据库 TaurusDB
人工智能
人脸识别服务 FRS
图引擎服务 GES
图像识别 Image
内容审核 Moderation
文字识别 OCR
AI开发平台ModelArts
图像搜索 ImageSearch
对话机器人服务 CBS
华为HiLens
视频智能分析服务 VIAS
语音交互服务 SIS
应用中间件
分布式缓存服务 DCS
API网关 APIG
微服务引擎 CSE
分布式消息服务Kafka版
分布式消息服务RabbitMQ版
分布式消息服务RocketMQ版
多活高可用服务 MAS
事件网格 EG
企业协同
华为云会议 Meeting
云通信
消息&短信 MSGSMS
云生态
合作伙伴中心
云商店
开发者工具
SDK开发指南
API签名指南
Terraform
华为云命令行工具服务 KooCLI
其他
产品价格详情
系统权限
管理控制台
客户关联华为云合作伙伴须知
消息中心
公共问题
开发与运维
应用管理与运维平台 ServiceStage
软件开发生产线 CodeArts
需求管理 CodeArts Req
部署 CodeArts Deploy
性能测试 CodeArts PerfTest
编译构建 CodeArts Build
流水线 CodeArts Pipeline
制品仓库 CodeArts Artifact
测试计划 CodeArts TestPlan
代码检查 CodeArts Check
代码托管 CodeArts Repo
云应用引擎 CAE
开天aPaaS
云消息服务 KooMessage
云手机服务 KooPhone
云空间服务 KooDrive

自定义底部菜单栏

更新时间:2024-07-30 GMT+08:00

自定义菜单主要用于实现会中界面底部菜单栏中菜单项的增减和自定义菜单项

底部菜单分两种场景,需要实现两种自定义方法:

1.ConfAudioToolbar:音频会议底部菜单栏自定义音频会议自定义菜单

2.ConfVideoToolbar:视频会议呼叫底部菜单栏自定义视频会议自定义菜单

使用场景

需要调整底部菜单栏中菜单项的应用场景

注意事项

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

自定义菜单设置

示例代码

1
2
3
4
ToolBarMenuProxy toolBarMenuProxy = new ToolBarMenuProxy();
toolBarMenuProxy.setConfAudioToolbarHandle(new CustomConfAudioToolbarHandle());
toolBarMenuProxy.setConfVideoToolbarHandle(new CustomConfVideoToolbarHandle());
sdkConfig.setToolBarMenuProxy(toolBarMenuProxy);

音频会议自定义菜单

图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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
 * 演示自定义"音频会议"场景下的toolbar菜单
 */
public class CustomConfAudioToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new SpeakerMenu());
        confMenus.add(new ParticipantMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ConnectAudioMenu());
        confMenus.add(new DisconnectAudioMenu());
        confMenus.add(new ChatMenu());
        confMenus.add(new InterpretMenu());
        confMenus.add(new HandsUpOrDownMenu());
        confMenus.add(new InviteMoreMenu());
        confMenus.add(new OpenOrCloseRecordMenu());
        confMenus.add(new SubtitlesMenu());
        confMenus.add(new CloudLiveMenu());
        confMenus.add(new VoteMenu());
        confMenus.add(new ConfSettingMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu howlDetectMenu = new SwitchMenu(R.id.hwmconf_confsetting_whistle_detection, R.string.hwmconf_mine_calling_setting_howl_auto_mute, true);
        IConfMenu noiseReductionMenu = new SwitchMenu(R.id.hwmconf_confsetting_noise_reduction,
                R.string.hwmconf_audio_noise_reduction, true);
        audioVideomenuChildren.add(howlDetectMenu);
        audioVideomenuChildren.add(noiseReductionMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_audio_video, R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> securityMenuChildren = new ArrayList<>();
        //锁定会议
        IConfMenu lockConfMenu = new SwitchMenu(R.id.hwmconf_confsetting_lock_meeting, R.string.hwmconf_lock, false);
        securityMenuChildren.add(lockConfMenu);
        //允许入会
        IConfMenu allowJoinConfMenu = new TextMenu(R.id.hwmconf_confsetting_allow_join_conf, R.string.hwmconf_allow_incoming_call, R.string.hwmconf_everyone);
        securityMenuChildren.add(allowJoinConfMenu);
        // 开启等候室
        IConfMenu enableWaitingRoomMenu = new SwitchMenu(R.id.hwmconf_confsetting_enable_waiting_room,
                R.string.hwmconf_enable_waiting_room, false);
        securityMenuChildren.add(enableWaitingRoomMenu);
        MenuContainer securityMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_security, R.string.hwmconf_setting_safe, securityMenuChildren);

        List<IConfMenu> attendeePermissionMenuChildren = new ArrayList<>();
        //允许解除静音
        IConfMenu allowReleaseMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_unmute, R.string.hwmconf_allow_ummute_self, false);
        IConfMenu allowShareMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_sharing, R.string.hwmconf_allow_sharing, false);
        // 抢占共享权限
        IConfMenu preemptShareTypeMenu = new TextMenu(R.id.hwmconf_confsetting_preempt_share_type,
                R.string.hwmconf_preempt_share_permission, R.string.hwmconf_preempt_share_only_host);
        // 聊天权限设置
        IConfMenu chatPermissionMenu = new TextMenu(R.id.hwmconf_confsetting_chat_permission,
                R.string.hwmconf_chat_settings, R.string.hwmconf_private_chat_free);
        //允许改名
        IConfMenu allowRenameMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_rename, R.string.hwmconf_set_allow_rename, true);
        IConfMenu allowLocalRecordMenu = new RouterMenu(R.id.hwmconf_confsetting_local_record_permission, R.string.hwmconf_allow_record, "");
        attendeePermissionMenuChildren.add(allowReleaseMuteMenu);
        attendeePermissionMenuChildren.add(allowShareMuteMenu);
        attendeePermissionMenuChildren.add(preemptShareTypeMenu);
        attendeePermissionMenuChildren.add(chatPermissionMenu);
        attendeePermissionMenuChildren.add(allowRenameMenu);
        attendeePermissionMenuChildren.add(allowLocalRecordMenu);
        MenuContainer attendeePermissionMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_paticipant_permission, R.string.hwmconf_setting_participant_permission, attendeePermissionMenuChildren);

        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        // 字幕翻译语言
        IConfMenu subtitlesLanguageMenu = new TextMenu(R.id.hwmconf_confsetting_subtitles_language, R.string.hwmconf_subtitle_translation_language, R.string.hwmconf_auto_no_translation);
        commonMenuChildren.add(subtitlesLanguageMenu);
        // 聊天消息提醒
        IConfMenu chatMessageRemindMenu = new TextMenu(R.id.hwmconf_confsetting_chat_message_remind,
                R.string.hwmconf_message_notify_mode, R.string.hwmconf_bubble_message_mode);
        commonMenuChildren.add(chatMessageRemindMenu);
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(R.id.hwmconf_confsetting_network_detect, R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_common, R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(securityMenuContainer);
        menus.add(attendeePermissionMenuContainer);
        menus.add(commonMenuContainer);
        return menus;
    }
}

视频会议自定义菜单

图4 视频会议自定义菜单
图5 视频会议更多自定义菜单
图6 视频会议会议设置自定义菜单

示例代码

  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
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/**
 * 演示自定义"视频会议"场景下的toolbar菜单
 */
public class CustomConfVideoToolbarHandle implements IToolbarMenuStrategy {
    @Override
    public List<IConfMenu> buildMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new CameraMenu());
        confMenus.add(new ParticipantMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ConnectAudioMenu());
        confMenus.add(new DisconnectAudioMenu());
        confMenus.add(new ChatMenu());
        confMenus.add(new InterpretMenu());
        confMenus.add(new HandsUpOrDownMenu());
        confMenus.add(new InviteMoreMenu());
        confMenus.add(new OpenOrCloseRecordMenu());
        confMenus.add(new SubtitlesMenu());
        confMenus.add(new CloudLiveMenu());
        confMenus.add(new SwitchCameraMenu());
        confMenus.add(new VirtualBackgroundMenu());
        confMenus.add(new VoteMenu());
        confMenus.add(new ConfSettingMenu());
        //【演示】增加一个自定义禁用放音菜单
        confMenus.add(new CustomDisableVoicePromptsMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        return confMenus;
    }
    @Override
    public List<IConfMenu> buildSettingMenuItems() {
        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu howlDetectMenu = new SwitchMenu(R.id.hwmconf_confsetting_whistle_detection, R.string.hwmconf_mine_calling_setting_howl_auto_mute, true);
        IConfMenu beautyMenu = new SwitchMenu(R.id.hwmconf_confsetting_beauty, R.string.hwmconf_setting_beauty, true);
        IConfMenu mirrorMenu = new SwitchMenu(R.id.hwmconf_confsetting_video_mirror, R.string.hwmconf_video_mirroring, true);
        IConfMenu pipMenu = new SwitchMenu(R.id.hwmconf_confsetting_hide_self, R.string.hwmconf_setting_pip, true);
        IConfMenu directionMenu = new RouterMenu(R.id.hwmconf_confsetting_camera_direction,
            R.string.hwmconf_auto, "cloudlink://hwmeeting/cameradirection");
        IConfMenu noiseReductionMenu = new SwitchMenu(R.id.hwmconf_confsetting_noise_reduction,
                R.string.hwmconf_audio_noise_reduction, true);
        IConfMenu highResMenu = new SwitchMenu(R.id.hwmconf_confsetting_high_resolution,
                R.string.hwmconf_mine_calling_setting_high_resolution, true);
        IConfMenu enableBrightenMenu = new SwitchMenu(R.id.hwmconf_confsetting_enable_brighten,
                R.string.hwmconf_enhance_video_quality, false);
        IConfMenu pictureRatioMenu = new TextMenu(R.id.hwmconf_confsetting_picture_ratio,
                R.string.hwmconf_picture_ratio, R.string.hwmconf_picture_ratio_original_size);
        audioVideomenuChildren.add(directionMenu);
        audioVideomenuChildren.add(howlDetectMenu);
        audioVideomenuChildren.add(beautyMenu);
        audioVideomenuChildren.add(mirrorMenu);
        audioVideomenuChildren.add(pipMenu);
        audioVideomenuChildren.add(noiseReductionMenu);
        audioVideomenuChildren.add(highResMenu);
        audioVideomenuChildren.add(enableBrightenMenu);
        audioVideomenuChildren.add(pictureRatioMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_audio_video, R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> securityMenuChildren = new ArrayList<>();
        //锁定会议
        IConfMenu lockConfMenu = new SwitchMenu(R.id.hwmconf_confsetting_lock_meeting, R.string.hwmconf_lock, false);
        securityMenuChildren.add(lockConfMenu);
        //允许入会
        IConfMenu allowJoinConfMenu = new TextMenu(R.id.hwmconf_confsetting_allow_join_conf,
                R.string.hwmconf_allow_incoming_call, R.string.hwmconf_everyone);
        securityMenuChildren.add(allowJoinConfMenu);
        IConfMenu enableWaitingRoomMenu = new SwitchMenu(R.id.hwmconf_confsetting_enable_waiting_room,
            R.string.hwmconf_enable_waiting_room, false);
        securityMenuChildren.add(enableWaitingRoomMenu);
        MenuContainer securityMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_security, R.string.hwmconf_setting_safe, securityMenuChildren);

        List<IConfMenu> attendeePermissionMenuChildren = new ArrayList<>();
        //允许解除静音
        IConfMenu allowReleaseMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_unmute, R.string.hwmconf_allow_ummute_self, false);
        //允许开启视频
        IConfMenu cameraRestrictionSwitch = new SwitchMenu(R.id.hwmconf_confsetting_allow_open_camera, R.string.hwmconf_allow_open_video, false);
        IConfMenu cameraRestrictionMenu = new RouterMenu(R.id.hwmconf_confsetting_camera_restriction, R.string.hwmconf_camera_restriction, "");
        IConfMenu allowShareMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_sharing, R.string.hwmconf_allow_sharing, false);
        // 抢占共享权限
        IConfMenu preemptShareTypeMenu = new TextMenu(R.id.hwmconf_confsetting_preempt_share_type,
                R.string.hwmconf_preempt_share_permission, R.string.hwmconf_preempt_share_only_host);
        // 聊天权限设置
        IConfMenu chatPermissionMenu = new TextMenu(R.id.hwmconf_confsetting_chat_permission,
                R.string.hwmconf_chat_settings, R.string.hwmconf_private_chat_free);
        //允许改名
        IConfMenu allowRenameMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_rename, R.string.hwmconf_set_allow_rename, true);
        IConfMenu allowLocalRecordMenu = new RouterMenu(R.id.hwmconf_confsetting_local_record_permission,
            R.string.hwmconf_allow_record, "");
        attendeePermissionMenuChildren.add(allowReleaseMuteMenu);
        attendeePermissionMenuChildren.add(cameraRestrictionSwitch);
        attendeePermissionMenuChildren.add(cameraRestrictionMenu);
        attendeePermissionMenuChildren.add(allowShareMuteMenu);
        attendeePermissionMenuChildren.add(preemptShareTypeMenu);
        attendeePermissionMenuChildren.add(chatPermissionMenu);
        attendeePermissionMenuChildren.add(allowRenameMenu);
        attendeePermissionMenuChildren.add(allowLocalRecordMenu);
        /*
         * 【演示】在会议设置里新增一个设置项
         */
        IConfMenu customeSettingMenuTest1 = new SwitchMenu(R.id.conf_setting_menu_test1, R.string.menu_conf_setting_menu_test1, false);
        attendeePermissionMenuChildren.add(customeSettingMenuTest1);
        MenuContainer attendeePermissionMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_paticipant_permission, R.string.hwmconf_setting_participant_permission, attendeePermissionMenuChildren);

        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        // 字幕翻译语言
        IConfMenu subtitlesLanguageMenu = new TextMenu(R.id.hwmconf_confsetting_subtitles_language, R.string.hwmconf_subtitle_translation_language, R.string.hwmconf_auto_no_translation);
        commonMenuChildren.add(subtitlesLanguageMenu);
        // 聊天消息提醒
        IConfMenu chatMessageRemindMenu = new TextMenu(R.id.hwmconf_confsetting_chat_message_remind,
                R.string.hwmconf_message_notify_mode, R.string.hwmconf_bubble_message_mode);
        commonMenuChildren.add(chatMessageRemindMenu);
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(R.id.hwmconf_confsetting_network_detect, R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_common, R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(securityMenuContainer);
        menus.add(attendeePermissionMenuContainer);
        menus.add(commonMenuContainer);

        /*
         * 【演示】在会议设置里新增加一个设置项组
         */
        List<IConfMenu> customChildren = new ArrayList<>();
        //网络检测
        IConfMenu customSettingMenuTest2 = new RouterMenu(R.id.conf_setting_menu_test2, R.string.menu_conf_setting_menu_test1, "test");
        customChildren.add(customSettingMenuTest2);
        MenuContainer customContainer = new MenuContainer(R.id.conf_setting_menu_test_group, R.string.menu_conf_setting_menu_test_group, customChildren);
        menus.add(customContainer);
        return menus;
    }
}

网络研讨会自定义菜单

图7 网络研讨会自定义菜单
图8 网络研讨会更多自定义菜单
图9 网络研讨会会议设置自定义菜单
示例代码
  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
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
/**
 * 演示自定义"网络研讨会"场景下的toolbar菜单
 */
public class CustomConfWebinarToolbarHandle implements IToolbarMenuStrategy {

    @Override
    public List<IConfMenu> buildMenuItems() {

        if (!NativeSDK.getConfMgrApi().isInConf()) {
            return buildAllMenuItems();
        }

        if (NativeSDK.getConfStateApi().getSelfRole() == ConfRole.ROLE_AUDIENCE) {
            return buildAudienceMenuItems();
        }

        if (NativeSDK.getConfStateApi().getSelfRole() == ConfRole.ROLE_HOST) {
            return buildHostMenuItems();
        }

        return buildAttendeeMenuItems();
    }

    private List<IConfMenu> buildAllMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new CameraMenu());
        if (TupConfig.isNeedConfChat()) {
            confMenus.add(new ChatMenu());
        }
        confMenus.add(new HandsMenu());
        if (TupConfig.isNeedScreenShare() && CpuLevelUtil.isHigherThan(CpuLevel.CALL_CPU_LEVEL_SUPER_LOW)) {
            confMenus.add(new ShareMenu());
        }
        if (ConfUIConfig.getInstance().isAudience()) {
            confMenus.add(new VoteBtnMenu());
        }
        confMenus.add(new AudienceJoinMenu());
        confMenus.add(new ParticipantMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }

    private List<IConfMenu> buildAudienceMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        if (TupConfig.isNeedConfChat()) {
            confMenus.add(new ChatMenu());
        }
        confMenus.add(new HandsMenu());
        if (ConfUIConfig.getInstance().isAudience()) {
            confMenus.add(new VoteBtnMenu());
        }
        confMenus.add(new MoreMenu());
        return confMenus;
    }

    private List<IConfMenu> buildAttendeeMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new CameraMenu());
        if (TupConfig.isNeedScreenShare() && CpuLevelUtil.isHigherThan(CpuLevel.CALL_CPU_LEVEL_SUPER_LOW)) {
            confMenus.add(new ShareMenu());
        }
        confMenus.add(new ParticipantMenu());
        if (ConfUIConfig.getInstance().isAudience()) {
            confMenus.add(new VoteBtnMenu());
        }
        confMenus.add(new MoreMenu());
        return confMenus;
    }

    private List<IConfMenu> buildHostMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new MicMenu());
        confMenus.add(new CameraMenu());
        confMenus.add(new AudienceJoinMenu());
        confMenus.add(new ParticipantMenu());
        confMenus.add(new MoreMenu());
        return confMenus;
    }

    @Override
    public List<IConfMenu> buildMoreMenuItems() {
        List<IConfMenu> confMenus = new ArrayList<>();
        confMenus.add(new ConnectAudioMenu());
        confMenus.add(new DisconnectAudioMenu());
        confMenus.add(new RenameMenu());
        confMenus.add(new StartOrStopShareMenu());
        confMenus.add(new ChatMenu());
        confMenus.add(new ShareConfLinkMenu());
        confMenus.add(new HandsUpOrDownMenu());
        confMenus.add(new InviteMoreMenu());
        confMenus.add(new OpenOrCloseRecordMenu());
        confMenus.add(new SubtitlesMenu());
        confMenus.add(new CloudLiveMenu());
        confMenus.add(new SwitchCameraMenu());
        confMenus.add(new VirtualBackgroundMenu());
        confMenus.add(new VoteMenu());
        confMenus.add(new ConfSettingMenu());
        //【演示】增加一个自定义菜单
        confMenus.add(new CustomMenu());
        return confMenus;
    }


    @Override
    public List<IConfMenu> buildSettingMenuItems() {

        List<IConfMenu> menus = new ArrayList<>();

        List<IConfMenu> audioVideomenuChildren = new ArrayList<>();
        IConfMenu howlDetectMenu = new SwitchMenu(R.id.hwmconf_confsetting_whistle_detection, com.huawei.hwmdemo.R.string.hwmconf_mine_calling_setting_howl_auto_mute, true);
        IConfMenu beautyMenu = new SwitchMenu(R.id.hwmconf_confsetting_beauty, com.huawei.hwmdemo.R.string.hwmconf_setting_beauty, true);
        IConfMenu mirrorMenu = new SwitchMenu(R.id.hwmconf_confsetting_video_mirror, R.string.hwmconf_video_mirroring, true);
        IConfMenu pipMenu = new SwitchMenu(R.id.hwmconf_confsetting_hide_self, com.huawei.hwmdemo.R.string.hwmconf_setting_pip, true);
        IConfMenu directionMenu = new RouterMenu(R.id.hwmconf_confsetting_camera_direction,
                R.string.hwmconf_auto, "cloudlink://hwmeeting/cameradirection");
        IConfMenu noiseReductionMenu = new SwitchMenu(R.id.hwmconf_confsetting_noise_reduction,
                R.string.hwmconf_audio_noise_reduction, true);
        IConfMenu highResMenu = new SwitchMenu(R.id.hwmconf_confsetting_high_resolution,
                R.string.hwmconf_mine_calling_setting_high_resolution, true);
        IConfMenu enableBrightenMenu = new SwitchMenu(R.id.hwmconf_confsetting_enable_brighten,
                R.string.hwmconf_enhance_video_quality, false);
        IConfMenu pictureRatioMenu = new TextMenu(R.id.hwmconf_confsetting_picture_ratio,
                R.string.hwmconf_picture_ratio, R.string.hwmconf_picture_ratio_original_size);
        audioVideomenuChildren.add(howlDetectMenu);
        audioVideomenuChildren.add(beautyMenu);
        audioVideomenuChildren.add(mirrorMenu);
        audioVideomenuChildren.add(pipMenu);
        audioVideomenuChildren.add(directionMenu);
        audioVideomenuChildren.add(noiseReductionMenu);
        audioVideomenuChildren.add(highResMenu);
        audioVideomenuChildren.add(enableBrightenMenu);
        audioVideomenuChildren.add(pictureRatioMenu);
        MenuContainer audioVideoMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_audio_video, com.huawei.hwmdemo.R.string.hwmconf_setting_audio_video, audioVideomenuChildren);

        List<IConfMenu> securityMenuChildren = new ArrayList<>();
        //锁定会议
        IConfMenu lockConfMenu = new SwitchMenu(R.id.hwmconf_confsetting_lock_meeting, com.huawei.hwmdemo.R.string.hwmconf_lock, false);
        securityMenuChildren.add(lockConfMenu);
        //允许入会
        IConfMenu allowJoinConfMenu = new TextMenu(R.id.hwmconf_confsetting_allow_join_conf,
                R.string.hwmconf_allow_incoming_call, R.string.hwmconf_everyone);
        securityMenuChildren.add(allowJoinConfMenu);
        // 开启等候室
        IConfMenu enableWaitingRoomMenu = new SwitchMenu(R.id.hwmconf_confsetting_enable_waiting_room,
                R.string.hwmconf_enable_waiting_room, false);
        securityMenuChildren.add(enableWaitingRoomMenu);
        MenuContainer securityMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_security, com.huawei.hwmdemo.R.string.hwmconf_setting_safe, securityMenuChildren);


        List<IConfMenu> attendeePermissionMenuChildren = new ArrayList<>();
        //允许解除静音
        IConfMenu allowReleaseMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_unmute, com.huawei.hwmdemo.R.string.hwmconf_allow_ummute_self, false);
        //允许开启视频
        IConfMenu cameraRestrictionSwitch = new SwitchMenu(R.id.hwmconf_confsetting_allow_open_camera, R.string.hwmconf_allow_open_video, false);
        IConfMenu cameraRestrictionMenu = new RouterMenu(R.id.hwmconf_confsetting_camera_restriction, R.string.hwmconf_camera_restriction, "");
        IConfMenu allowShareMuteMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_sharing, com.huawei.hwmdemo.R.string.hwmconf_allow_sharing, false);
        // 抢占共享权限
        IConfMenu preemptShareTypeMenu = new TextMenu(R.id.hwmconf_confsetting_preempt_share_type,
                R.string.hwmconf_preempt_share_permission, R.string.hwmconf_preempt_share_only_host);
        //聊天权限设置
        IConfMenu chatPermissionMenu = new TextMenu(R.id.hwmconf_confsetting_chat_permission,
                R.string.hwmconf_chat_settings, R.string.hwmconf_private_chat_free);//允许改名
        //允许改名
        IConfMenu allowRenameMenu = new SwitchMenu(R.id.hwmconf_confsetting_allow_rename, com.huawei.hwmdemo.R.string.hwmconf_set_allow_rename, true);
        IConfMenu allowLocalRecordMenu = new RouterMenu(R.id.hwmconf_confsetting_local_record_permission,
            R.string.hwmconf_allow_record, "");
        attendeePermissionMenuChildren.add(allowReleaseMuteMenu);
        attendeePermissionMenuChildren.add(cameraRestrictionSwitch);
        attendeePermissionMenuChildren.add(cameraRestrictionMenu);
        attendeePermissionMenuChildren.add(allowShareMuteMenu);
        attendeePermissionMenuChildren.add(preemptShareTypeMenu);
        attendeePermissionMenuChildren.add(chatPermissionMenu);
        attendeePermissionMenuChildren.add(allowRenameMenu);
        attendeePermissionMenuChildren.add(allowLocalRecordMenu);
        /*
         * 【演示】在会议设置里新增一个设置项
         */
        IConfMenu customeSettingMenuTest1 = new SwitchMenu(com.huawei.hwmdemo.R.id.conf_setting_menu_test1, com.huawei.hwmdemo.R.string.menu_conf_setting_menu_test1, false);
        attendeePermissionMenuChildren.add(customeSettingMenuTest1);
        MenuContainer attendeePermissionMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_paticipant_permission, com.huawei.hwmdemo.R.string.hwmconf_setting_participant_permission, attendeePermissionMenuChildren);


        List<IConfMenu> commonMenuChildren = new ArrayList<>();
        // 字幕翻译语言
        IConfMenu subtitlesLanguageMenu = new TextMenu(R.id.hwmconf_confsetting_subtitles_language, R.string.hwmconf_subtitle_translation_language, R.string.hwmconf_auto_no_translation);
        commonMenuChildren.add(subtitlesLanguageMenu);
        // 聊天消息提醒
        IConfMenu chatMessageRemindMenu = new TextMenu(R.id.hwmconf_confsetting_chat_message_remind,
                R.string.hwmconf_message_notify_mode, R.string.hwmconf_bubble_message_mode);
        commonMenuChildren.add(chatMessageRemindMenu);
        //网络检测
        IConfMenu networkDetectMenu = new RouterMenu(R.id.hwmconf_confsetting_network_detect, com.huawei.hwmdemo.R.string.hwmconf_network_check, "cloudlink://hwmeeting/networkdetection");
        commonMenuChildren.add(networkDetectMenu);
        MenuContainer commonMenuContainer = new MenuContainer(R.id.hwmconf_setting_menu_common, com.huawei.hwmdemo.R.string.hwmconf_setting_common, commonMenuChildren);

        menus.add(audioVideoMenuContainer);
        menus.add(securityMenuContainer);
        menus.add(attendeePermissionMenuContainer);
        menus.add(commonMenuContainer);

        /*
         * 【演示】在会议设置里新增加一个设置项组
         */
        List<IConfMenu> customChildren = new ArrayList<>();
        //网络检测
        IConfMenu customeSettingMenuTest2 = new RouterMenu(com.huawei.hwmdemo.R.id.conf_setting_menu_test2, com.huawei.hwmdemo.R.string.menu_conf_setting_menu_test1, "test");
        customChildren.add(customeSettingMenuTest2);
        MenuContainer customContainer = new MenuContainer(com.huawei.hwmdemo.R.id.conf_setting_menu_test_group, com.huawei.hwmdemo.R.string.menu_conf_setting_menu_test_group, customChildren);
        menus.add(customContainer);

        return menus;
    }
}

我们使用cookie来确保您的高速浏览体验。继续浏览本站,即表示您同意我们使用cookie。 详情

文档反馈

文档反馈

意见反馈

0/500

标记内容

同时提交标记内容