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

共享工具栏定制

screenShareToolBarItems

接口描述

该接口用于共享工具栏左侧区域按钮的定制。

下图中框选部分按钮最多可定制8个按钮,多余按钮将不会被展示。

图1 共享按钮定制位置

注意事项

传入的按钮如果当前场景不支持或当前角色不支持将不会被展示;

方法定义

1
- (nullable NSArray <HWMToolBarItemModel *> *)screenShareToolBarItems;

参数描述

返回值

示例代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 构建共享工具栏按钮
- (nullable NSArray <HWMToolBarItemModel *> *)screenShareToolBarItems {
    // 麦克风
    HWMToolBarItemModel *micItem = [HWMToolBarItemModel defaultMicrophoneItem];
    // 扬声器
    HWMToolBarItemModel *speakerItem = [HWMToolBarItemModel defaultSpeakerItem];
    // 摄像头
    HWMToolBarItemModel *cameraItem = [HWMToolBarItemModel defaultCameraItem];
    // 与会者
    HWMToolBarItemModel *participantItem = [HWMToolBarItemModel defaultParticipantItem];
    // 自定义
    HWMToolBarItemModel *customItem = [[HWMToolBarItemModel alloc]init];
    customItem.title = @"自定义";
    customItem.selectedTitle = @"选中自定义";
    customItem.iconImage = [NSImage imageNamed:@"icon-customize-select-normal"];
    customItem.selectedIconImage = [NSImage imageNamed:@"icon-customize-select-selected"];
    customItem.disabledIconImage = [NSImage imageNamed:@"icon-customize-select-normal"];
    // 聊天
    HWMToolBarItemModel *chatItem = [HWMToolBarItemModel defaultChatItem];
    // 更多
    HWMToolBarItemModel *moreItem = [HWMToolBarItemModel defaultMoreItem];

    return @[micItem, speakerItem, cameraItem, participantItem, customItem,chatItem, moreItem];
}

相关文档