Skip to content

Commit e5573af

Browse files
committed
[sendDisplayNotification] - resolve merge conflicts
2 parents 417b377 + 8f655d2 commit e5573af

File tree

11 files changed

+147
-26
lines changed

11 files changed

+147
-26
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ you do the following:
3535
2. Add reference to it on BigBlueButton's `/create` call or add it on `/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties`:
3636

3737
```
38-
pluginsManifests=[{"url": "http://localhost:4701/manifest.json"}]
38+
pluginManifests=[{"url": "http://localhost:4701/manifest.json"}]
3939
```
4040

4141
*Running from souce code with a remote BBB-server*
@@ -78,7 +78,7 @@ or
7878
5. Add this create parameter into the API-mate of the server you are testing it on:
7979

8080
```
81-
pluginsManifests=[{"url": "https://<uuid>.ngrok-free.app/manifest.json"}]
81+
pluginManifests=[{"url": "https://<uuid>.ngrok-free.app/manifest.json"}]
8282
```
8383

8484
And there you go, you can test it freely.
@@ -195,34 +195,34 @@ const {
195195
deleteEntry: deleteEntryFunction, // Function to delete specific item or wipe all
196196
replaceEntry: replaceEntryFunction, // Function replace a specifi item
197197
} = useDataChannel<CustomType>(
198-
channelName, // Defined according to what is on settings.yml from bbb-htlm5
198+
channelName, // Defined according to what is on manifest.json
199199
DataChannelTypes.All_ITEMS, // | LATEST_ITEM | NEW_ITEMS -> ALL_ITEMS is default
200200
subChannelName = 'default', // If no subchannelName is specified, it will be 'default'
201201
);
202202
```
203203

204204
Wiping all data off will delete every item from the specific data-channel within the specific subchannel-name.
205205

206-
The data-channel name must be written in the settings.yml.
207-
208-
All the permission for writing and deleting must be in the yaml too just like the example ahead:
209-
210-
```yaml
211-
public:
212-
plugins:
213-
- name: PluginName
214-
url: http://<your-hosted-plugin>/PluginName.js
215-
dataChannels:
216-
- name: channel-name
217-
# pushPermission options: moderator, presenter, all
218-
pushPermission: ['moderator','presenter']
219-
# replaceOrDeletePermission options: moderator, presenter, creator, all
220-
replaceOrdeletePermission:
221-
- moderator
222-
- sender
223-
```
206+
**Data-channel configuration:**
207+
208+
The data-channel name must be in the `manifest.json` along with all the permissions for writting, reading and deleting, see example below:
209+
210+
```json
211+
{
212+
"requiredSdkVersion": "~0.0.59",
213+
"name": "PluginName",
214+
"javascriptEntrypointUrl": "PluginName.js",
215+
"dataChannels":[
216+
{
217+
"name": "channel-name",
218+
"pushPermission": ["moderator","presenter"],
219+
"replaceOrDeletePermission": ["moderator", "sender"]
220+
}
221+
]
222+
}
223+
```
224224

225-
If no permission is mentioned in the yaml (writing or deleting), no one will be able proceed with that specific action:
225+
If no permission is mentioned in that file (writing or deleting), no one will be able proceed with that specific action:
226226

227227
The `pushEntryFunction` has a minor detail to pay attention to, it is possible to specify the users who you want to send the item to, if none is specified, all will receive the item, such as done ahead:
228228

@@ -367,7 +367,7 @@ Then when creating the meeting send the following parameters along, adjusting to
367367

368368
```
369369
meta_pluginSettingsUserInformation=https://<your-external-source-with-your-authentication>/api/users
370-
pluginsManifests=[{"url": "http://<domain-of-your-manifest>/your-plugin/manifest.json"}]
370+
pluginManifests=[{"url": "http://<domain-of-your-manifest>/your-plugin/manifest.json"}]
371371
```
372372

373373
In the plugin, just use the function like:
@@ -440,12 +440,12 @@ No, feel free to host it anywhere you want, just make sure to point the URL from
440440
**I am making my plugin based on a sample inside the SDK, but somehow, the sample is not working properly, what do I do to run it in dev mode and make it work?**
441441
Well there are several motives to why the sample is not working properly, so I will go through each one of them briefly:
442442

443-
- The config has not been set properly inside `bbb-html5.yml`, see [this section to configure your plugin](#running-the-plugin-from-source);
443+
- The config has not been set properly in `manifest.json`, see [this section to configure your plugin](#running-the-plugin-from-source);
444444
- The plugin is not even running in dev mode, it could be the port already in use, or typescript and/or javascript errors (Make sure to initialize the `pluginApi` as any of the samples inside a react function component);
445445
- It could be an error with that sample indeed, or that feature the plugin uses broke (it is not usual, but can happen since BBB is constantly changing and enhancing its features with its wonderful community). If that happens, just open an issue in the [SDK&#39;s github](https://github.com/bigbluebutton/bigbluebutton-html-plugin-sdk) detailing the error you are facing. And thank you in advance for reporting it back to us so we can improve each time.
446446

447447
**How to troubleshoot the plugins? See if it has loaded in the BBB, for instance.**
448-
Well, each time a set of plugins are listed in the `bbb-html5.yml`, it will fire some logs based on the amount of plugins that it need to load inside the client. So open the console in the browser by pressing F12 key in your keyboard and search for the following log:
448+
Well, each time a set of plugins listed to be run into a specific meeting start, it will fire some logs based on the amount of plugins that it need to load inside the client. So open the console in the browser by pressing F12 key in your keyboard and search for the following log:
449449

450450
```log
451451
<ratio of loaded plugins> plugins loaded

samples/sample-action-button-dropdown-plugin/src/components/sample-action-button-dropdown-plugin-item/component.tsx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
UiLayouts,
1515
pluginLogger,
1616
NotificationTypeUiCommand,
17+
ChangeEnforcedLayoutTypeEnum,
1718
} from 'bigbluebutton-html-plugin-sdk';
1819
import * as ReactDOM from 'react-dom/client';
1920
import { IsMeetingBreakoutGraphqlResponse, SampleActionButtonDropdownPluginProps } from './types';
@@ -41,6 +42,8 @@ function SampleActionButtonDropdownPlugin(
4142
isOpen: true,
4243
}]);
4344

45+
const [isCamerasOnly, setIsCamerasOnly] = useState(false);
46+
4447
const { data: isMeetingBreakoutFromGraphql } = pluginApi.useCustomSubscription<
4548
IsMeetingBreakoutGraphqlResponse>(IS_MEETING_BREAKOUT);
4649

@@ -128,6 +131,18 @@ function SampleActionButtonDropdownPlugin(
128131
handleFetchPresentationData(currentPresentation);
129132
},
130133
}),
134+
new ActionButtonDropdownOption({
135+
label: 'Close actions bar for 5 seconds',
136+
icon: 'copy',
137+
tooltip: 'this is a button injected by plugin',
138+
allowed: true,
139+
onClick: () => {
140+
pluginApi.uiCommands.actionsBar.setDisplayActionBar({ displayActionBar: false });
141+
setTimeout(() => {
142+
pluginApi.uiCommands.actionsBar.setDisplayActionBar({ displayActionBar: true });
143+
}, 5000);
144+
},
145+
}),
131146
new ActionButtonDropdownOption({
132147
label: 'Stop notifications',
133148
icon: 'copy',
@@ -144,9 +159,26 @@ function SampleActionButtonDropdownPlugin(
144159
allowed: true,
145160
onClick: handleChangePresentationAreaContent,
146161
}),
162+
new ActionButtonDropdownOption({
163+
label: (!isCamerasOnly) ? 'Switch to cameras only layout' : 'Switch to custom layout',
164+
icon: 'copy',
165+
tooltip: 'this is a button injected by plugin',
166+
allowed: true,
167+
onClick: (!isCamerasOnly) ? () => {
168+
pluginApi.uiCommands.layout.changeEnforcedLayout(
169+
ChangeEnforcedLayoutTypeEnum.CAMERAS_ONLY,
170+
);
171+
setIsCamerasOnly(true);
172+
} : () => {
173+
pluginApi.uiCommands.layout.changeEnforcedLayout(
174+
ChangeEnforcedLayoutTypeEnum.CUSTOM_LAYOUT,
175+
);
176+
setIsCamerasOnly(false);
177+
},
178+
}),
147179
]);
148180
}
149-
}, [currentPresentation, currentUser, showingGenericContentInPresentationArea]);
181+
}, [currentPresentation, currentUser, showingGenericContentInPresentationArea, isCamerasOnly]);
150182

151183
return (
152184
<ReactModal
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { ActionsBarEnum } from './enums';
2+
import { SetDisplayActionBarCommandArguments } from './types';
3+
4+
export const actionsBar = {
5+
/**
6+
* Decides whether to display the actions bar
7+
*
8+
* @param setSpeakerLevelCommandArgumentsthe volume to which the core will set the speaker
9+
* level.
10+
* Refer to {@link SetDisplayActionBarCommandArguments} to understand the argument structure.
11+
*/
12+
setDisplayActionBar: (arg: SetDisplayActionBarCommandArguments) => {
13+
const { displayActionBar } = arg;
14+
window.dispatchEvent(new CustomEvent<
15+
SetDisplayActionBarCommandArguments
16+
>(ActionsBarEnum.SET_DISPLAY_ACTIONS_BAR, {
17+
detail: {
18+
displayActionBar,
19+
},
20+
}));
21+
},
22+
};

src/ui-commands/actions-bar/enums.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export enum ActionsBarEnum {
2+
SET_DISPLAY_ACTIONS_BAR = 'SET_DISPLAY_ACTIONS_BAR_COMMAND',
3+
}

src/ui-commands/actions-bar/types.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface SetDisplayActionBarCommandArguments {
2+
displayActionBar: boolean;
3+
}
4+
5+
export interface UiCommandsActionsBarObject {
6+
setDisplayActionBar: (
7+
arg: SetDisplayActionBarCommandArguments
8+
) => void;
9+
}

src/ui-commands/commands.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ import { presentationArea } from './presentation-area/commands';
55
import { userStatus } from './user-status/commands';
66
import { conference } from './conference/commands';
77
import { notification } from './notification/commands';
8+
import { actionsBar } from './actions-bar/commands';
9+
import { layout } from './layout/commands';
810

911
export const uiCommands = {
12+
actionsBar,
1013
chat,
1114
externalVideo,
1215
sidekickOptionsContainer,
1316
presentationArea,
1417
userStatus,
1518
conference,
1619
notification,
20+
layout,
1721
};

src/ui-commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export { NotificationTypeUiCommand } from './notification/enums';
2+
export { ChangeEnforcedLayoutTypeEnum } from './layout/enums';

src/ui-commands/layout/commands.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { ChangeEnforcedLayoutTypeEnum, LayoutEnum } from './enums';
2+
import { ChangeEnforcedLayout, ChangeEnforcedLayoutCommandArguments } from './types';
3+
4+
export const layout = {
5+
/**
6+
* <description>
7+
*
8+
* @param
9+
*/
10+
changeEnforcedLayout: ((layoutType: ChangeEnforcedLayoutTypeEnum) => {
11+
window.dispatchEvent(
12+
new CustomEvent<
13+
ChangeEnforcedLayoutCommandArguments
14+
>(LayoutEnum.CHANGE_ENFORCED_LAYOUT, {
15+
detail: {
16+
layoutType,
17+
},
18+
}),
19+
);
20+
}) as ChangeEnforcedLayout,
21+
};

src/ui-commands/layout/enums.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export enum LayoutEnum {
2+
CHANGE_ENFORCED_LAYOUT = 'CHANGE_ENFORCED_LAYOUT',
3+
}
4+
5+
export enum ChangeEnforcedLayoutTypeEnum {
6+
CUSTOM_LAYOUT = 'CUSTOM_LAYOUT',
7+
SMART_LAYOUT = 'SMART_LAYOUT',
8+
PRESENTATION_FOCUS = 'PRESENTATION_FOCUS',
9+
VIDEO_FOCUS = 'VIDEO_FOCUS',
10+
CAMERAS_ONLY = 'CAMERAS_ONLY',
11+
PRESENTATION_ONLY = 'PRESENTATION_ONLY',
12+
PARTICIPANTS_AND_CHAT_ONLY = 'PARTICIPANTS_AND_CHAT_ONLY',
13+
MEDIA_ONLY = 'MEDIA_ONLY',
14+
}

src/ui-commands/layout/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ChangeEnforcedLayoutTypeEnum } from './enums';
2+
3+
export interface ChangeEnforcedLayoutCommandArguments {
4+
layoutType: ChangeEnforcedLayoutTypeEnum;
5+
}
6+
7+
export type ChangeEnforcedLayout = (layoutType: ChangeEnforcedLayoutTypeEnum) => void;
8+
9+
export interface UiCommandsLayoutObject {
10+
changeEnforcedLayout: ChangeEnforcedLayout;
11+
}

0 commit comments

Comments
 (0)