Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into v0.1.x #152

Merged
merged 23 commits into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
417b377
[sendDisplayNotification] - Added possibility for the plugin develope…
GuiLeme Dec 6, 2024
1cd94d6
[self-view-disabled] - Added ui command setSelfViewDisabledAllDevices…
GuiLeme Dec 11, 2024
a8e2341
[self-view-disabled] - added cameras to useCurrentUser and added self…
GuiLeme Dec 13, 2024
e5573af
[sendDisplayNotification] - resolve merge conflicts
GuiLeme Dec 13, 2024
110c6de
[sendDisplayNotification] - changed the name of the ui-command
GuiLeme Dec 13, 2024
a004ac1
[self-view-disabled] - resolving conflict errors
GuiLeme Dec 13, 2024
eb9d526
[sendDisplayNotification] - resolve merge conflicts
GuiLeme Jan 22, 2025
3b119fc
[self-view-disabled] - Changes in review
GuiLeme Jan 22, 2025
5698037
docs: use npm ci in production build in README.md
antobinary Jan 23, 2025
2bdfc09
Merge pull request #136 from GuiLeme/sendDisplayNotification
antobinary Jan 27, 2025
cb2ce13
Merge pull request #139 from GuiLeme/self-view-disabled
GuiLeme Jan 28, 2025
08bc4e6
Bump version to 0.0.71
TiagoJacobs Jan 29, 2025
6db8d3a
[enhance-documentation-1] - Added information on the remote-data-sour…
GuiLeme Feb 3, 2025
74613a7
changes in review
GuiLeme Feb 3, 2025
668fbdc
Merge pull request #145 from GuiLeme/enhance-documentation-1
antobinary Feb 3, 2025
4dfbc6c
Merge pull request #144 from bigbluebutton/antobinary-patch-1
antobinary Feb 3, 2025
210ae32
Revert "feat(plugin): asset persistence" (#146)
TiagoJacobs Feb 6, 2025
7e4c40f
Bump nanoid (#140)
dependabot[bot] Feb 6, 2025
2ff14ec
Bump version to 0.0.72
TiagoJacobs Feb 6, 2025
b4dfc04
[locale-messages] - Added new useLocaleMessages function to the plugi…
GuiLeme Feb 11, 2025
e513912
[locale-messages] - added documentation for useLocaleMessages
GuiLeme Feb 11, 2025
5cafe66
Merge pull request #147 from GuiLeme/locale-messages
antobinary Feb 13, 2025
b4d0f08
Bump version to 0.0.73
TiagoJacobs Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ follow these steps:

```bash
cd $HOME/src/bigbluebutton-html-plugin-sdk/samples/sample-action-button-dropdown-plugin
npm install
npm ci
npm run build-bundle
```

Expand Down Expand Up @@ -142,7 +142,7 @@ Here is as complete `manifet.json` example with all possible configurations:
{
"name": "allUsers",
"url": "${meta_pluginSettingsUserInformation}",
"fetchMode": "onMeetingCreate",
"fetchMode": "onMeetingCreate", // Possible values: "onMeetingCreate", "onDemand"
"permissions": ["moderator", "viewer"]
}
]
Expand Down Expand Up @@ -188,10 +188,11 @@ That being said, here are the extensible areas we have so far:

Mind that no plugin will interfere into another's extensible area. So feel free to set whatever you need into a certain plugin with no worries.

### Getters available through the API:
### Auxiliar functions:

- `getSessionToken`: returns the user session token located on the user's URL.
- `getJoinUrl`: returns the join url associated with the parameters passed as an argument. Since it fetches the BigBlueButton API, this getter method is asynchronous.
- `useLocaleMessages`: returns the messages to be used in internationalization functions (recommend to use `react-intl`, as example, refer to official plugins)

### Realtime data consumption

Expand Down Expand Up @@ -397,21 +398,32 @@ This is possible by simply configuring the dataResource name in the manifest and
{
"name": "allUsers",
"url": "${meta_pluginSettingsUserInformation}",
"fetchMode": "onMeetingCreate",
"permissions": ["moderator", "viewer"]
"fetchMode": "onMeetingCreate", // Possible values: "onMeetingCreate", "onDemand"
"permissions": ["moderator", "viewer"] // Possible values: "moderator", "viewer", "presenter"
}
]
}
```

Then when creating the meeting send the following parameters along, adjusting to your needs and resources:
Going through each parameter to better understand it's structure:

- `name`: It is the name of the remote data source, that is the name you'll use later on in the plugin when developing it;
- `url`: The Url to which the data will be fetched (it can be hard-coded in the `manifest.json`, but we recommend passing it as a `meta_` parameter);
- `fetchMode`: It tells the plugin-server if it should fetch the data only when creating the meeting, or everytime the function is called in the plugin portion;
- If one chooses `onMeetingCreate`, the data will be fetched when the create endpoint of the meeting is called, then it's cached in the plugin-server so that everytime the plugin wants that data, the plugin-server will respond with the cached data;
- On the other hand, if `onDemand` is selected, everytime the plugin calls this method, the plugin-server will fetch the data and then proxy it to the plugin;
- `permissions`: This tells the back-end which role of the meeting can access this remote data;

Here is the `/create` parameters you would have to pass to make this remote-data-source api work:

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

In the plugin, just use the function like:
See that we send the `meta_` parameter, for more information, refer to the [meta parameters section](#meta_-parameters)

Lastly, in the plugin, just use the function like:

```typescript
pluginApi.getRemoteData('allUsers').then((response: Response) => {
Expand All @@ -427,6 +439,12 @@ pluginApi.getRemoteData('allUsers').then((response: Response) => {
});
```

### Meta_ parameters

This is not part of the API, but it's a way of passing information to the manifest. Any value can be passed like this, one just needs to put something like `${meta_nameOfParameter}` in a specific config of the manifest, and in the `/create` call, set this meta-parameter to whatever is preferred, like `meta_nameOfParameter="Sample message"`

This feature is mainly used for security purposes, see [external data section](#external-data-resources). But can be used for customization reasons as well.

### Event persistence

This feature will allow the developer to save an information (which is basically an event) in the `event.xml` file of the meeting if it's being recorded.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bigbluebutton-html-plugin-sdk",
"version": "0.0.70",
"version": "0.0.73",
"homepage": "https://github.com/bigbluebutton/bigbluebutton-html-plugin-sdk",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
6 changes: 1 addition & 5 deletions samples/sample-action-button-dropdown-plugin/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@
"name": "SampleActionButtonDropdownPlugin",
"javascriptEntrypointUrl": "SampleActionButtonDropdownPlugin.js",
"localesBaseUrl": "https://cdn.dominio.com/pluginabc/",
"assetPersistence": {
"enabled": true,
"maxFileSize": 10000000,
"maxUploadSizePerUser": 100000000
}
"enabledForBreakoutRooms": true
}
14 changes: 7 additions & 7 deletions samples/sample-action-button-dropdown-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/sample-action-button-dropdown-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"bigbluebutton-html-plugin-sdk": "0.0.70",
"bigbluebutton-html-plugin-sdk": "0.0.73",
"path": "^0.12.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { useState, useEffect } from 'react';
import { AssetType } from 'bigbluebutton-html-plugin-sdk/dist/cjs/asset-persistence/enums';
import * as ReactModal from 'react-modal';
import './style.css';

Expand Down Expand Up @@ -45,26 +44,18 @@ function SampleActionButtonDropdownPlugin(

const [isCamerasOnly, setIsCamerasOnly] = useState(false);

const [isSelfViewDisabled, setIsSelfViewDisabled] = useState(false);
const { data: isMeetingBreakoutFromGraphql } = pluginApi.useCustomSubscription<
IsMeetingBreakoutGraphqlResponse>(IS_MEETING_BREAKOUT);

useEffect(() => {
// This line is commented once it will upload a
// PDF everytime you enter a meeting
// (if you have presenter role).
// Uncomment them to test this feature!
pluginApi.persistAsset(
'https://pdfobject.com/pdf/sample.pdf',
AssetType.PRESENTATION,
'my-presentation.pdf',
);
pluginApi.uiCommands.notification.send({
message: 'Notification message',
icon: 'presentation',
type: NotificationTypeUiCommand.INFO,
options: {
// helpLabel: 'test help label', // this is not necessary
// helpLink: 'test help link',
// helpLabel: 'teste help label', // this is not necessary
// helpLink: 'teste help link',
autoClose: 20000,
},
content: 'Content of my notification',
Expand Down Expand Up @@ -165,6 +156,15 @@ function SampleActionButtonDropdownPlugin(
}, 5000);
},
}),
new ActionButtonDropdownOption({
label: 'Stop notifications',
icon: 'copy',
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: () => {
pluginApi.uiCommands.notification.setEnabledDisplayNotifications(false);
},
}),
new ActionButtonDropdownOption({
label: showingGenericContentInPresentationArea ? 'Return previous presentation content' : 'Set different content in presentation area',
icon: 'copy',
Expand All @@ -189,9 +189,27 @@ function SampleActionButtonDropdownPlugin(
setIsCamerasOnly(false);
},
}),
new ActionButtonDropdownOption({
label: !(isSelfViewDisabled) ? 'Disable camera self view' : 'Enable self view',
icon: 'desktop',
tooltip: 'this is a button injected by plugin',
allowed: true,
onClick: !(isSelfViewDisabled) ? () => {
setIsSelfViewDisabled(true);
pluginApi.uiCommands.camera.setSelfViewDisableAllDevices({
isSelfViewDisabledAllDevices: true,
});
} : () => {
setIsSelfViewDisabled(false);
pluginApi.uiCommands.camera.setSelfViewDisableAllDevices({
isSelfViewDisabledAllDevices: false,
});
},
}),
]);
}
}, [currentPresentation, currentUser, showingGenericContentInPresentationArea, isCamerasOnly]);
}, [currentPresentation, currentUser, isSelfViewDisabled,
showingGenericContentInPresentationArea]);

return (
<ReactModal
Expand Down
8 changes: 4 additions & 4 deletions samples/sample-actions-bar-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/sample-actions-bar-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"bigbluebutton-html-plugin-sdk": "0.0.70",
"bigbluebutton-html-plugin-sdk": "0.0.73",
"path": "^0.12.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
14 changes: 7 additions & 7 deletions samples/sample-audio-settings-dropdown-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion samples/sample-audio-settings-dropdown-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"bigbluebutton-html-plugin-sdk": "0.0.70",
"bigbluebutton-html-plugin-sdk": "0.0.73",
"browser-bunyan": "^1.8.0",
"path": "^0.12.7",
"react": "^18.2.0",
Expand Down
14 changes: 7 additions & 7 deletions samples/sample-camera-settings-dropdown-plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@types/react": "^18.2.13",
"@types/react-dom": "^18.2.6",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"bigbluebutton-html-plugin-sdk": "0.0.70",
"bigbluebutton-html-plugin-sdk": "0.0.73",
"path": "^0.12.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
14 changes: 7 additions & 7 deletions samples/sample-custom-subscription-hook/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading