Help Center/ Meeting/ Client SDK Reference/ macOS SDK/ APIs/ UI Customization/ Customizing the Sharing Toolbar
Updated on 2024-07-30 GMT+08:00

Customizing the Sharing Toolbar

screenShareToolBarItems

API Description

This API is used to customize buttons on the sharing toolbar.

A maximum of eight buttons can be customized in the boxed area in the following figure. Extra buttons will not be displayed.

Figure 1 Buttons can be customized on the sharing toolbar

Precautions

If the current scenario or role does not support the transferred button, the button will not be displayed.

Method Definition

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

Parameter Description

None

Return Values

None

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Customize buttons on the sharing toolbar.
- (nullable NSArray <HWMToolBarItemModel *> *)screenShareToolBarItems {
    // Microphone
    HWMToolBarItemModel *micItem = [HWMToolBarItemModel defaultMicrophoneItem];
    // Speaker
    HWMToolBarItemModel *speakerItem = [HWMToolBarItemModel defaultSpeakerItem];
    // Camera
    HWMToolBarItemModel *cameraItem = [HWMToolBarItemModel defaultCameraItem];
    // Participants
    HWMToolBarItemModel *participantItem = [HWMToolBarItemModel defaultParticipantItem];
    // Custom
    HWMToolBarItemModel *customItem = [[HWMToolBarItemModel alloc]init];
    customItem.title = @"Custom";
    customItem.selectedTitle = @"Select the custom button.";
    customItem.iconImage = [NSImage imageNamed:@"icon-customize-select-normal"];
    customItem.selectedIconImage = [NSImage imageNamed:@"icon-customize-select-selected"];
    customItem.disabledIconImage = [NSImage imageNamed:@"icon-customize-select-normal"];
    // Chat
    HWMToolBarItemModel *chatItem = [HWMToolBarItemModel defaultChatItem];
    // More
    HWMToolBarItemModel *moreItem = [HWMToolBarItemModel defaultMoreItem];

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