UNPKG

bigbluebutton-html-plugin-sdk

Version:

This repository contains the SDK for developing BigBlueButton plugins. Plugins are React components that can be loaded from external sources by the BigBlueButton HTML5 client to extend its functionalities.

20 lines 913 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var react_1 = require("react"); var enum_1 = require("../../enum"); var useShouldUnmountPlugin = function () { var _a = (0, react_1.useState)(false), shouldUnmountPlugin = _a[0], setShouldUnmountPlugin = _a[1]; var handleMeetingStatusChange = (function (customEvent) { var eventDetail = customEvent.detail; setShouldUnmountPlugin(!eventDetail.data.userCurrentlyInMeeting); }); (0, react_1.useEffect)(function () { window.addEventListener(enum_1.HookEvents.BBB_CORE_UPDATED_MEETING_STATUS, handleMeetingStatusChange); return function () { window.removeEventListener(enum_1.HookEvents.BBB_CORE_UPDATED_MEETING_STATUS, handleMeetingStatusChange); }; }, []); return shouldUnmountPlugin; }; exports.default = useShouldUnmountPlugin; //# sourceMappingURL=hook.js.map