@selfcommunity/react-ui 0.11.0-alpha.6 → 0.11.0-alpha.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/cjs/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/cjs/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/cjs/components/ComposerIconButton/ComposerIconButton.js +9 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/cjs/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/cjs/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/cjs/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/cjs/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +10 -2
- package/lib/cjs/components/Editor/Editor.js +9 -9
- package/lib/cjs/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/cjs/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/cjs/components/Editor/plugins/HorizontalRulePlugin.js +34 -0
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/cjs/components/Editor/plugins/LexicalRichTextPlugin.js +2 -3
- package/lib/cjs/components/Event/Event.js +6 -3
- package/lib/cjs/components/EventForm/EventAddress.js +1 -1
- package/lib/cjs/components/EventForm/EventForm.js +40 -22
- package/lib/cjs/components/EventForm/utils.d.ts +1 -0
- package/lib/cjs/components/EventForm/utils.js +6 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/cjs/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/cjs/components/EventHeader/EventHeader.js +3 -2
- package/lib/cjs/components/EventMembersWidget/EventMembersWidget.js +12 -12
- package/lib/cjs/components/EventMembersWidget/TabContentComponent.js +8 -8
- package/lib/cjs/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/cjs/components/EventMembersWidget/types.js +7 -7
- package/lib/cjs/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/cjs/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
- package/lib/cjs/components/Events/Events.d.ts +11 -0
- package/lib/cjs/components/Events/Events.js +21 -10
- package/lib/cjs/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/cjs/components/Events/OngoingEventsFilter.js +24 -0
- package/lib/cjs/components/FeedObject/Actions/Share/Share.js +4 -1
- package/lib/cjs/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/cjs/components/Footer/Footer.js +9 -6
- package/lib/cjs/components/Footer/constants.d.ts +1 -0
- package/lib/cjs/components/Footer/constants.js +2 -1
- package/lib/cjs/components/GroupForm/GroupForm.js +2 -2
- package/lib/cjs/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/cjs/components/Groups/Groups.js +18 -16
- package/lib/cjs/components/LiveStreamForm/LiveStreamForm.js +65 -6
- package/lib/cjs/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/cjs/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +106 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +37 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +62 -5
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/cjs/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/cjs/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/cjs/components/Notification/Event/Event.js +20 -2
- package/lib/cjs/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
- package/lib/cjs/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/cjs/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/cjs/constants/LiveStream.d.ts +1 -0
- package/lib/cjs/constants/LiveStream.js +2 -1
- package/lib/cjs/shared/EventActionsMenu/index.js +5 -1
- package/lib/cjs/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/cjs/utils/buttonCounters.d.ts +1 -0
- package/lib/cjs/utils/buttonCounters.js +4 -3
- package/lib/cjs/utils/events.d.ts +1 -0
- package/lib/cjs/utils/events.js +6 -1
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.d.ts +5 -0
- package/lib/esm/components/CategoryAutocomplete/CategoryAutocomplete.js +3 -3
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.d.ts +1 -1
- package/lib/esm/components/Composer/Layer/CategoryLayer/CategoryLayer.js +4 -1
- package/lib/esm/components/ComposerIconButton/ComposerIconButton.js +10 -2
- package/lib/esm/components/CreateEventButton/CreateEventButton.d.ts +1 -1
- package/lib/esm/components/CreateEventButton/CreateEventButton.js +1 -1
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.d.ts +0 -6
- package/lib/esm/components/CreateLiveStreamButton/CreateLiveStreamButton.js +2 -9
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.d.ts +10 -4
- package/lib/esm/components/CreateLiveStreamDialog/CreateLiveStreamDialog.js +17 -11
- package/lib/esm/components/CreateLiveStreamDialog/LiveStreamSelector/LiveStreamSelector.js +12 -4
- package/lib/esm/components/Editor/Editor.js +8 -8
- package/lib/esm/components/Editor/nodes/HashtagNode.js +2 -0
- package/lib/esm/components/Editor/nodes/MentionNode.js +2 -0
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.d.ts +8 -0
- package/lib/esm/components/Editor/plugins/HorizontalRulePlugin.js +30 -0
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.d.ts +2 -2
- package/lib/esm/components/Editor/plugins/LexicalRichTextPlugin.js +1 -1
- package/lib/esm/components/Event/Event.js +6 -3
- package/lib/esm/components/EventForm/EventAddress.js +1 -1
- package/lib/esm/components/EventForm/EventForm.js +42 -24
- package/lib/esm/components/EventForm/utils.d.ts +1 -0
- package/lib/esm/components/EventForm/utils.js +4 -0
- package/lib/esm/components/EventFormDialog/EventFormDialog.d.ts +1 -1
- package/lib/esm/components/EventFormDialog/EventFormDialog.js +3 -3
- package/lib/esm/components/EventHeader/EventHeader.js +3 -2
- package/lib/esm/components/EventMembersWidget/EventMembersWidget.js +14 -14
- package/lib/esm/components/EventMembersWidget/TabContentComponent.js +9 -9
- package/lib/esm/components/EventMembersWidget/types.d.ts +4 -5
- package/lib/esm/components/EventMembersWidget/types.js +6 -6
- package/lib/esm/components/EventParticipantsButton/EventParticipantsButton.js +1 -1
- package/lib/esm/components/EventSubscribeButton/EventSubscribeButton.js +1 -1
- package/lib/esm/components/Events/Events.d.ts +11 -0
- package/lib/esm/components/Events/Events.js +22 -11
- package/lib/esm/components/Events/OngoingEventsFilter.d.ts +8 -0
- package/lib/esm/components/Events/OngoingEventsFilter.js +21 -0
- package/lib/esm/components/FeedObject/Actions/Share/Share.js +4 -1
- package/lib/esm/components/FeedObject/Activities/Activities.js +1 -1
- package/lib/esm/components/Footer/Footer.js +10 -7
- package/lib/esm/components/Footer/constants.d.ts +1 -0
- package/lib/esm/components/Footer/constants.js +1 -0
- package/lib/esm/components/GroupForm/GroupForm.js +2 -2
- package/lib/esm/components/GroupInvitedWidget/GroupInvitedWidget.js +1 -1
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +1 -1
- package/lib/esm/components/Groups/Groups.js +21 -19
- package/lib/esm/components/LiveStreamForm/LiveStreamForm.js +67 -8
- package/lib/esm/components/LiveStreamForm/LiveStreamFormSettings.js +8 -3
- package/lib/esm/components/LiveStreamRoom/LiveStreamRoom.js +8 -6
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ControlBar.js +3 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.d.ts +2 -1
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/FocusLayout.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts +9 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.js +103 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.d.ts +4 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/NoParticipants.js +34 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.d.ts +1 -0
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/ParticipantTile.js +2 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.d.ts +3 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/PreJoin.js +45 -2
- package/lib/esm/components/LiveStreamRoom/LiveStreamVideoConference/VideoConference.js +66 -9
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.d.ts +3 -1
- package/lib/esm/components/NavigationMenuIconButton/NavigationMenuDrawer.js +13 -6
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.d.ts +1 -1
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +2 -2
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.d.ts +1 -1
- package/lib/esm/components/NavigationToolbarMobile/NavigationToolbarMobile.js +4 -4
- package/lib/esm/components/Notification/Event/Event.js +21 -3
- package/lib/esm/components/RelatedEventsWidget/RelatedEventsWidget.js +1 -2
- package/lib/esm/components/SearchDialog/SearchDialog.d.ts +4 -1
- package/lib/esm/components/SearchDialog/SearchDialog.js +2 -2
- package/lib/esm/constants/LiveStream.d.ts +1 -0
- package/lib/esm/constants/LiveStream.js +1 -0
- package/lib/esm/shared/EventActionsMenu/index.js +6 -2
- package/lib/esm/shared/UpScalingTierBadge/index.js +9 -0
- package/lib/esm/utils/buttonCounters.d.ts +1 -0
- package/lib/esm/utils/buttonCounters.js +3 -2
- package/lib/esm/utils/events.d.ts +1 -0
- package/lib/esm/utils/events.js +4 -0
- package/lib/umd/239.js +2 -0
- package/lib/umd/react-ui.js +1 -1
- package/package.json +14 -13
- package/lib/umd/653.js +0 -2
- /package/lib/umd/{653.js.LICENSE.txt → 239.js.LICENSE.txt} +0 -0
|
@@ -26,6 +26,7 @@ const classes = {
|
|
|
26
26
|
root: `${constants_1.PREFIX}-root`,
|
|
27
27
|
content: `${constants_1.PREFIX}-content`,
|
|
28
28
|
title: `${constants_1.PREFIX}-title`,
|
|
29
|
+
logo: `${constants_1.PREFIX}-logo`,
|
|
29
30
|
description: `${constants_1.PREFIX}-description`,
|
|
30
31
|
endConferenceWrap: `${constants_1.PREFIX}-end-conference-wrap`,
|
|
31
32
|
btnBackHome: `${constants_1.PREFIX}-btn-back-home`,
|
|
@@ -75,7 +76,7 @@ const DialogRoot = (0, styles_1.styled)(BaseDialog_1.default, {
|
|
|
75
76
|
* @param inProps
|
|
76
77
|
*/
|
|
77
78
|
function LiveStreamRoom(inProps) {
|
|
78
|
-
var _a, _b, _c, _d
|
|
79
|
+
var _a, _b, _c, _d;
|
|
79
80
|
//PROPS
|
|
80
81
|
const props = (0, system_1.useThemeProps)({
|
|
81
82
|
props: inProps,
|
|
@@ -202,12 +203,13 @@ function LiveStreamRoom(inProps) {
|
|
|
202
203
|
/**
|
|
203
204
|
* Renders root object
|
|
204
205
|
*/
|
|
205
|
-
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: scLiveStream.closed_at_by_host ? ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ open: true, maxWidth: 'md', fullWidth: true }, { children: (0, jsx_runtime_1.jsxs)(DialogContent_1.default, Object.assign({ className: classes.endConferenceWrap }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.conference.closed", defaultMessage: "ui.liveStreamRoom.conference.closed" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: "secondary", component: react_core_1.Link, to: '/', className: classes.btnBackHome }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) }))] })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startPrejoinContent && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "h4", className: classes.title, alignContent: 'center' }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: (0, classnames_1.default)(classes.preJoin, { [classes.preJoinLoading]: loading || error }) }, { children: [(0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(PreJoin_1.PreJoin, { defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError, joinLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.joinRoom', defaultMessage: 'ui.liveStreamRoom.preJoin.joinRoom' }), micLabel: intl.formatMessage({
|
|
206
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest, { children: scLiveStream.closed_at_by_host ? ((0, jsx_runtime_1.jsx)(DialogRoot, Object.assign({ open: true, maxWidth: 'md', fullWidth: true }, { children: (0, jsx_runtime_1.jsxs)(DialogContent_1.default, Object.assign({ className: classes.endConferenceWrap }, { children: [(0, jsx_runtime_1.jsx)(react_core_1.Link, Object.assign({ to: scRoutingContext.url(react_core_1.SCRoutes.HOME_ROUTE_NAME, {}), className: classes.logo }, { children: (0, jsx_runtime_1.jsx)("img", { src: preferences[react_core_1.SCPreferences.LOGO_NAVBAR_LOGO].value, alt: "logo" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h5" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.conference.closed", defaultMessage: "ui.liveStreamRoom.conference.closed" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: "secondary", component: react_core_1.Link, to: '/', className: classes.btnBackHome }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.button.backHome", defaultMessage: "ui.liveStreamRoom.button.backHome" }) }))] })) }))) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.content, "data-lk-theme": "default" }, { children: connectionDetails === undefined || preJoinChoices === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [startPrejoinContent && (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.startPrejoinContent }, { children: startPrejoinContent })), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title) && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "h4", className: classes.title, alignContent: 'center' }, { children: scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.title }))), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: (0, classnames_1.default)(classes.preJoin, { [classes.preJoinLoading]: loading || error }) }, { children: [(0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(PreJoin_1.PreJoin, { defaults: preJoinDefaults, onSubmit: handlePreJoinSubmit, onError: handlePreJoinError, joinLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.joinRoom', defaultMessage: 'ui.liveStreamRoom.preJoin.joinRoom' }), micLabel: intl.formatMessage({
|
|
206
207
|
id: 'ui.liveStreamRoom.preJoin.microphone',
|
|
207
208
|
defaultMessage: 'ui.liveStreamRoom.preJoin.microphone'
|
|
208
|
-
}), camLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.camera', defaultMessage: 'ui.liveStreamRoom.preJoin.camera' }), userLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.username', defaultMessage: 'ui.liveStreamRoom.preJoin.username' }) }) })), loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.prejoinLoader }, { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children: [
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
}), camLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.camera', defaultMessage: 'ui.liveStreamRoom.preJoin.camera' }), userLabel: intl.formatMessage({ id: 'ui.liveStreamRoom.preJoin.username', defaultMessage: 'ui.liveStreamRoom.preJoin.username' }) }) })), loading && ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.prejoinLoader }, { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, {}), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: 'div', variant: "body2" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.connecting", defaultMessage: "ui.liveStreamRoom.connecting" }) }))] })))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ className: classes.endPrejoinContent }, { children: [scLiveStream && ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ sx: { width: '47%' }, spacing: 1, className: classes.endPrejoinContentBox }, { children: [scLiveStream &&
|
|
210
|
+
scUserContext.user &&
|
|
211
|
+
scUserContext.user.id !== scLiveStream.host.id &&
|
|
212
|
+
scLiveStream &&
|
|
213
|
+
(((_a = scLiveStream.settings) === null || _a === void 0 ? void 0 : _a.muteParticipants) || ((_b = scLiveStream.settings) === null || _b === void 0 ? void 0 : _b.disableVideo)) && ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ variant: "filled", severity: "info", className: classes.preJoinAlert }, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: (0, jsx_runtime_1.jsx)("b", { children: "Info" }) }), ((_c = scLiveStream.settings) === null || _c === void 0 ? void 0 : _c.muteParticipants) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["-", ' ', (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableMicrophone", defaultMessage: "ui.liveStreamRoom.hostDisableMicrophone" }), (0, jsx_runtime_1.jsx)("br", {})] })), ((_d = scLiveStream.settings) === null || _d === void 0 ? void 0 : _d.disableVideo) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: ["- ", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.hostDisableVideo", defaultMessage: "ui.liveStreamRoom.hostDisableVideo" })] }))] }))), (0, jsx_runtime_1.jsx)(CopyTextArea_1.default, { className: classes.shareLink, value: `${appUrl}${scRoutingContext.url(react_core_1.SCRoutes.LIVESTREAM_ROUTE_NAME, scLiveStream)}`, label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.shareLink", defaultMessage: "ui.liveStreamRoom.shareLink" }) }), (scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description) && ((0, jsx_runtime_1.jsxs)(material_1.Alert, Object.assign({ variant: "filled", severity: "info", className: classes.description }, { children: [(0, jsx_runtime_1.jsx)(material_1.AlertTitle, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.description", defaultMessage: "ui.liveStreamRoom.description" }) }) }), scLiveStream === null || scLiveStream === void 0 ? void 0 : scLiveStream.description] })))] }))), endPrejoinContent] }))] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ className: classes.conference }, { children: (0, jsx_runtime_1.jsx)(LiveStreamProvider_1.LiveStreamContext.Provider, Object.assign({ value: { liveStream: scLiveStream } }, { children: (0, jsx_runtime_1.jsx)(LiveStreamVideoConference_1.default, Object.assign({ connectionDetails: connectionDetails, userChoices: preJoinChoices }, LiveStreamVideoConferenceComponentProps)) })) }))) }))) })));
|
|
212
214
|
}
|
|
213
215
|
exports.default = LiveStreamRoom;
|
|
@@ -12,6 +12,7 @@ const material_1 = require("@mui/material");
|
|
|
12
12
|
const SettingsMenuToggle_1 = require("./SettingsMenuToggle");
|
|
13
13
|
const DisconnectButton_1 = require("./DisconnectButton");
|
|
14
14
|
const utils_1 = require("./utils");
|
|
15
|
+
const react_intl_1 = require("react-intl");
|
|
15
16
|
/**
|
|
16
17
|
* The `ControlBar` prefab gives the user the basic user interface to control their
|
|
17
18
|
* media devices (camera, microphone and screen share), open the `Chat` and leave the room.
|
|
@@ -57,6 +58,7 @@ function ControlBar(_a) {
|
|
|
57
58
|
});
|
|
58
59
|
const microphoneOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveAudioInputEnabled(enabled) : null), [saveAudioInputEnabled]);
|
|
59
60
|
const cameraOnChange = React.useCallback((enabled, isUserInitiated) => (isUserInitiated ? saveVideoInputEnabled(enabled) : null), [saveVideoInputEnabled]);
|
|
60
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, htmlProps, { children: [visibleControls.microphone && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group" }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.Microphone, showIcon: showIcon, onChange: microphoneOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.Microphone, error }) }, { children: showText &&
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, htmlProps, { children: [visibleControls.microphone && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group" }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.Microphone, showIcon: showIcon, onChange: microphoneOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.Microphone, error }) }, { children: showText && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.microphone", defaultMessage: "ui.liveStreamRoom.controlBar.microphone" }) })) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { kind: "audioinput", onActiveDeviceChange: (_kind, deviceId) => saveAudioInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.camera && ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group" }, { children: [(0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.Camera, showIcon: showIcon, onChange: cameraOnChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.Camera, error }) }, { children: showText && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.camera", defaultMessage: "ui.liveStreamRoom.controlBar.camera" }) })) }), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { kind: "videoinput", onActiveDeviceChange: (_kind, deviceId) => saveVideoInputDeviceId(deviceId !== null && deviceId !== void 0 ? deviceId : '') }) }))] }))), visibleControls.screenShare && browserSupportsScreenSharing && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ source: livekit_client_1.Track.Source.ScreenShare, captureOptions: { audio: true, selfBrowserSurface: 'include', surfaceSwitching: 'exclude' }, showIcon: showIcon, onChange: onScreenShareChange, onDeviceError: (error) => onDeviceError === null || onDeviceError === void 0 ? void 0 : onDeviceError({ source: livekit_client_1.Track.Source.ScreenShare, error }) }, { children: showText &&
|
|
62
|
+
(isScreenShareEnabled ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.stopShareScreen", defaultMessage: "ui.liveStreamRoom.controlBar.stopShareScreen" })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.shareScreen", defaultMessage: "ui.liveStreamRoom.controlBar.shareScreen" }))) })) })), visibleControls.chat && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(components_react_1.ChatToggle, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.ChatIcon, {}), showText && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.chat", defaultMessage: "ui.liveStreamRoom.controlBar.chat" })] }) })), visibleControls.settings && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(SettingsMenuToggle_1.SettingsMenuToggle, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.GearIcon, {}), showText && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.settings", defaultMessage: "ui.liveStreamRoom.controlBar.settings" })] }) })), visibleControls.leave && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(DisconnectButton_1.DisconnectButton, { children: [showIcon && (0, jsx_runtime_1.jsx)(components_react_1.LeaveIcon, {}), showText && (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.controlBar.leave", defaultMessage: "ui.liveStreamRoom.controlBar.leave" })] }) })), (0, jsx_runtime_1.jsx)(components_react_1.StartMediaButton, {})] })));
|
|
61
63
|
}
|
|
62
64
|
exports.ControlBar = ControlBar;
|
|
@@ -13,9 +13,10 @@ export declare function FocusLayoutContainerNoParticipants(props: FocusLayoutCon
|
|
|
13
13
|
export interface FocusLayoutProps extends React.HTMLAttributes<HTMLElement> {
|
|
14
14
|
/** The track to display in the focus layout. */
|
|
15
15
|
trackRef?: TrackReferenceOrPlaceholder;
|
|
16
|
+
disableTileFocusToggle?: boolean;
|
|
16
17
|
onParticipantClick?: (evt: ParticipantClickEvent) => void;
|
|
17
18
|
}
|
|
18
19
|
/**
|
|
19
20
|
* The `FocusLayout` component is just a light wrapper around the `ParticipantTile` to display a single participant.
|
|
20
21
|
*/
|
|
21
|
-
export declare function FocusLayout({ trackRef, ...htmlProps }: FocusLayoutProps): JSX.Element;
|
|
22
|
+
export declare function FocusLayout({ trackRef, disableTileFocusToggle, ...htmlProps }: FocusLayoutProps): JSX.Element;
|
|
@@ -25,9 +25,9 @@ exports.FocusLayoutContainerNoParticipants = FocusLayoutContainerNoParticipants;
|
|
|
25
25
|
* The `FocusLayout` component is just a light wrapper around the `ParticipantTile` to display a single participant.
|
|
26
26
|
*/
|
|
27
27
|
function FocusLayout(_a) {
|
|
28
|
-
var { trackRef } = _a, htmlProps = tslib_1.__rest(_a, ["trackRef"]);
|
|
28
|
+
var { trackRef, disableTileFocusToggle = false } = _a, htmlProps = tslib_1.__rest(_a, ["trackRef", "disableTileFocusToggle"]);
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
30
|
// @ts-ignore
|
|
31
|
-
return (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, Object.assign({ trackRef: trackRef }, htmlProps));
|
|
31
|
+
return (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, Object.assign({ trackRef: trackRef, disableTileFocusToggle: disableTileFocusToggle }, htmlProps));
|
|
32
32
|
}
|
|
33
33
|
exports.FocusLayout = FocusLayout;
|
package/lib/cjs/components/LiveStreamRoom/LiveStreamVideoConference/LiveStreamSettingsMenu.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface LiveStreamSettingsMenuProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
blurEnabled?: boolean;
|
|
4
|
+
handleBlur?: (event: any) => void;
|
|
5
|
+
actionBlurDisabled?: boolean;
|
|
6
|
+
onlyContentMenu?: boolean;
|
|
7
|
+
hideRecordAction?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export default function LiveStreamSettingsMenu(inProps: LiveStreamSettingsMenuProps): JSX.Element;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Button_1 = tslib_1.__importDefault(require("@mui/material/Button"));
|
|
7
|
+
const Menu_1 = tslib_1.__importDefault(require("@mui/material/Menu"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const styles_1 = require("@mui/material/styles");
|
|
10
|
+
const system_1 = require("@mui/system");
|
|
11
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
12
|
+
// import {useIsRecording, useMaybeLayoutContext, useRoomContext} from '@livekit/components-react';
|
|
13
|
+
const react_1 = require("react");
|
|
14
|
+
const react_intl_1 = require("react-intl");
|
|
15
|
+
const PREFIX = 'SCLiveStreamSettingsMenu';
|
|
16
|
+
const classes = {
|
|
17
|
+
root: `${PREFIX}-root`,
|
|
18
|
+
menuRoot: `${PREFIX}-menu-root`
|
|
19
|
+
};
|
|
20
|
+
const Root = (0, styles_1.styled)(Button_1.default, {
|
|
21
|
+
name: PREFIX,
|
|
22
|
+
slot: 'Root',
|
|
23
|
+
overridesResolver: (props, styles) => styles.root
|
|
24
|
+
})(({ theme }) => ({
|
|
25
|
+
borderRadius: 7,
|
|
26
|
+
color: theme.palette.common.white,
|
|
27
|
+
paddingLeft: theme.spacing(),
|
|
28
|
+
paddingRight: theme.spacing(),
|
|
29
|
+
minWidth: 45
|
|
30
|
+
}));
|
|
31
|
+
const MenuRoot = (0, styles_1.styled)(Menu_1.default, {
|
|
32
|
+
name: PREFIX,
|
|
33
|
+
slot: 'Root',
|
|
34
|
+
overridesResolver: (props, styles) => styles.menuRoot
|
|
35
|
+
})(({ theme }) => ({
|
|
36
|
+
'& .MuiPaper-root': {
|
|
37
|
+
minWidth: 120,
|
|
38
|
+
paddingRight: theme.spacing(2),
|
|
39
|
+
'& div.MuiTypography-body1': {
|
|
40
|
+
paddingLeft: theme.spacing(2)
|
|
41
|
+
},
|
|
42
|
+
'& .MuiFormControlLabel-label.Mui-disabled': {
|
|
43
|
+
color: theme.palette.text.primary
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
function LiveStreamSettingsMenu(inProps) {
|
|
48
|
+
// PROPS
|
|
49
|
+
const props = (0, system_1.useThemeProps)({
|
|
50
|
+
props: inProps,
|
|
51
|
+
name: PREFIX
|
|
52
|
+
});
|
|
53
|
+
const { className, actionBlurDisabled = false, blurEnabled = false, handleBlur, hideRecordAction = true, onlyContentMenu = false } = props, rest = tslib_1.__rest(props, ["className", "actionBlurDisabled", "blurEnabled", "handleBlur", "hideRecordAction", "onlyContentMenu"]);
|
|
54
|
+
const [anchorEl, setAnchorEl] = React.useState(null);
|
|
55
|
+
const open = Boolean(anchorEl);
|
|
56
|
+
/*
|
|
57
|
+
// Recording: https://github.com/livekit-examples/meet/blob/main/lib/SettingsMenu.tsx
|
|
58
|
+
const room = useRoomContext();
|
|
59
|
+
const isRecording = useIsRecording();
|
|
60
|
+
const [initialRecStatus, setInitialRecStatus] = useState(isRecording);
|
|
61
|
+
const [processingRecRequest, setProcessingRecRequest] = useState(false);
|
|
62
|
+
const recordingEndpoint = process.env.NEXT_PUBLIC_LK_RECORD_ENDPOINT;
|
|
63
|
+
*/
|
|
64
|
+
const handleClick = (event) => {
|
|
65
|
+
setAnchorEl(event.currentTarget);
|
|
66
|
+
};
|
|
67
|
+
const handleClose = () => {
|
|
68
|
+
setAnchorEl(null);
|
|
69
|
+
};
|
|
70
|
+
/* useEffect(() => {
|
|
71
|
+
if (initialRecStatus !== isRecording) {
|
|
72
|
+
setProcessingRecRequest(false);
|
|
73
|
+
}
|
|
74
|
+
}, [isRecording, initialRecStatus]);
|
|
75
|
+
|
|
76
|
+
const toggleRoomRecording = async () => {
|
|
77
|
+
/* if (!recordingEndpoint) {
|
|
78
|
+
throw TypeError('No recording endpoint specified');
|
|
79
|
+
}
|
|
80
|
+
if (room.isE2EEEnabled) {
|
|
81
|
+
throw Error('Recording of encrypted meetings is currently not supported');
|
|
82
|
+
}
|
|
83
|
+
setProcessingRecRequest(true);
|
|
84
|
+
setInitialRecStatus(isRecording);
|
|
85
|
+
let response: Response;
|
|
86
|
+
if (isRecording) {
|
|
87
|
+
response = await fetch(recordingEndpoint + `/stop?roomName=${room.name}`);
|
|
88
|
+
} else {
|
|
89
|
+
response = await fetch(recordingEndpoint + `/start?roomName=${room.name}`);
|
|
90
|
+
}
|
|
91
|
+
if (response.ok) {
|
|
92
|
+
} else {
|
|
93
|
+
console.error('Error handling recording request, check server logs:', response.status, response.statusText);
|
|
94
|
+
setProcessingRecRequest(false);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
*/
|
|
98
|
+
const MenuContent = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", component: "div" }, { children: (0, jsx_runtime_1.jsx)("b", { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.settingsMenu.visualEffect", defaultMessage: "ui.liveStreamRoom.settingsMenu.visualEffect" }) }) })), (0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { labelPlacement: "start", control: (0, jsx_runtime_1.jsx)(material_1.Switch, { checked: blurEnabled, disabled: actionBlurDisabled, onChange: handleBlur, inputProps: { 'aria-label': 'controlled' } }), label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.settingsMenu.visualEffect.blurEffect", defaultMessage: "ui.liveStreamRoom.settingsMenu.visualEffect.blurEffect" }) })] })), [blurEnabled, actionBlurDisabled, handleBlur]);
|
|
99
|
+
if (onlyContentMenu) {
|
|
100
|
+
return MenuContent;
|
|
101
|
+
}
|
|
102
|
+
return ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root, 'lk-button'), "aria-controls": open ? 'live-stream-settings-menu' : undefined, "aria-haspopup": "true", "aria-expanded": open ? 'true' : undefined, onClick: handleClick }, rest, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, { children: "more_vert" }) })), (0, jsx_runtime_1.jsx)(MenuRoot, Object.assign({ id: "live-stream-settings-menu", anchorEl: anchorEl, open: open, onClose: handleClose, MenuListProps: {
|
|
103
|
+
'aria-labelledby': 'basic-button'
|
|
104
|
+
} }, { children: MenuContent }))] }));
|
|
105
|
+
}
|
|
106
|
+
exports.default = LiveStreamSettingsMenu;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const system_1 = require("@mui/system");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
9
|
+
const react_intl_1 = require("react-intl");
|
|
10
|
+
const PREFIX = 'SCNoParticipants';
|
|
11
|
+
const classes = {
|
|
12
|
+
root: `${PREFIX}-root`
|
|
13
|
+
};
|
|
14
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
15
|
+
name: PREFIX,
|
|
16
|
+
slot: 'Root',
|
|
17
|
+
overridesResolver: (props, styles) => styles.root
|
|
18
|
+
})(({ theme }) => ({
|
|
19
|
+
display: 'flex',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
backgroundColor: '#1e1e1e',
|
|
23
|
+
transition: 'opacity .2sease-in-out',
|
|
24
|
+
pointerEvents: 'none',
|
|
25
|
+
borderRadius: 7
|
|
26
|
+
}));
|
|
27
|
+
function NoParticipants(inProps) {
|
|
28
|
+
// PROPS
|
|
29
|
+
const props = (0, system_1.useThemeProps)({
|
|
30
|
+
props: inProps,
|
|
31
|
+
name: PREFIX
|
|
32
|
+
});
|
|
33
|
+
const { className } = props, rest = tslib_1.__rest(props, ["className"]);
|
|
34
|
+
// RENDER
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root) }, rest, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.noParticipants", defaultMessage: "ui.liveStreamRoom.noParticipants" }) })));
|
|
36
|
+
}
|
|
37
|
+
exports.default = NoParticipants;
|
|
@@ -19,6 +19,7 @@ export interface ParticipantTileProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
19
19
|
trackRef?: TrackReferenceOrPlaceholder;
|
|
20
20
|
disableSpeakingIndicator?: boolean;
|
|
21
21
|
disableTileActions?: boolean;
|
|
22
|
+
disableTileFocusToggle?: boolean;
|
|
22
23
|
onParticipantClick?: (event: ParticipantClickEvent) => void;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
@@ -34,7 +34,7 @@ exports.TrackRefContextIfNeeded = TrackRefContextIfNeeded;
|
|
|
34
34
|
exports.ParticipantTile =
|
|
35
35
|
/* @__PURE__ */ React.forwardRef(function ParticipantTile(_a, ref) {
|
|
36
36
|
var _b, _c;
|
|
37
|
-
var { trackRef, children, onParticipantClick, disableSpeakingIndicator, disableTileActions = false } = _a, htmlProps = tslib_1.__rest(_a, ["trackRef", "children", "onParticipantClick", "disableSpeakingIndicator", "disableTileActions"]);
|
|
37
|
+
var { trackRef, children, onParticipantClick, disableSpeakingIndicator, disableTileFocusToggle = false, disableTileActions = false } = _a, htmlProps = tslib_1.__rest(_a, ["trackRef", "children", "onParticipantClick", "disableSpeakingIndicator", "disableTileFocusToggle", "disableTileActions"]);
|
|
38
38
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
39
39
|
const trackReference = (0, components_react_1.useEnsureTrackRef)(trackRef);
|
|
40
40
|
const { elementProps } = (0, components_react_1.useParticipantTile)({
|
|
@@ -61,5 +61,5 @@ exports.ParticipantTile =
|
|
|
61
61
|
trackReference.source === livekit_client_1.Track.Source.ScreenShare) ? ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(components_react_1.VideoTrack, { trackRef: trackReference, onSubscriptionStatusChanged: handleSubscribe, manageSubscription: autoManageSubscription }) })) : ((0, components_core_1.isTrackReference)(trackReference) && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(components_react_1.AudioTrack, { trackRef: trackReference, onSubscriptionStatusChanged: handleSubscribe }) }))), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-participant-placeholder" }, { children: (0, jsx_runtime_1.jsx)(ParticipantTileAvatar_1.default, { participant: trackReference.participant }) })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-participant-metadata" }, { children: [(0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-participant-metadata-item" }, { children: trackReference.source === livekit_client_1.Track.Source.Camera ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEncrypted && (0, jsx_runtime_1.jsx)(components_react_1.LockLockedIcon, { style: { marginRight: '0.25rem' } }), (0, jsx_runtime_1.jsx)(components_react_1.TrackMutedIndicator, { trackRef: {
|
|
62
62
|
participant: trackReference.participant,
|
|
63
63
|
source: livekit_client_1.Track.Source.Microphone
|
|
64
|
-
}, show: 'muted' }), (0, jsx_runtime_1.jsx)(components_react_1.ParticipantName, { children: !disableTileActions && (0, jsx_runtime_1.jsx)(ParticipantTileActions_1.default, {}) })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_react_1.ScreenShareIcon, { style: { marginRight: '0.25rem' } }), (0, jsx_runtime_1.jsx)(components_react_1.ParticipantName, { children: "'s screen" })] })) })), (0, jsx_runtime_1.jsx)(components_react_1.ConnectionQualityIndicator, { className: "lk-participant-metadata-item" })] }))] })), (0, jsx_runtime_1.jsx)(components_react_1.FocusToggle, { trackRef: trackReference })] })) })) })));
|
|
64
|
+
}, show: 'muted' }), (0, jsx_runtime_1.jsx)(components_react_1.ParticipantName, { children: !disableTileActions && (0, jsx_runtime_1.jsx)(ParticipantTileActions_1.default, {}) })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_react_1.ScreenShareIcon, { style: { marginRight: '0.25rem' } }), (0, jsx_runtime_1.jsx)(components_react_1.ParticipantName, { children: "'s screen" })] })) })), (0, jsx_runtime_1.jsx)(components_react_1.ConnectionQualityIndicator, { className: "lk-participant-metadata-item" })] }))] })), !disableTileFocusToggle && (0, jsx_runtime_1.jsx)(components_react_1.FocusToggle, { trackRef: trackReference })] })) })) })));
|
|
65
65
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CreateLocalTracksOptions, LocalAudioTrack, LocalTrack, LocalVideoTrack } from 'livekit-client';
|
|
2
|
-
import { Track } from 'livekit-client';
|
|
2
|
+
import { Track, TrackProcessor } from 'livekit-client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import type { LocalUserChoices } from '@livekit/components-core';
|
|
5
5
|
/**
|
|
@@ -28,6 +28,7 @@ export interface PreJoinProps extends Omit<React.HTMLAttributes<HTMLDivElement>,
|
|
|
28
28
|
* @alpha
|
|
29
29
|
*/
|
|
30
30
|
persistUserChoices?: boolean;
|
|
31
|
+
videoProcessor?: TrackProcessor<Track.Kind.Video>;
|
|
31
32
|
}
|
|
32
33
|
/** @alpha */
|
|
33
34
|
export declare function usePreviewTracks(options: CreateLocalTracksOptions, onError?: (err: Error) => void): {
|
|
@@ -55,4 +56,4 @@ export declare function usePreviewDevice<T extends LocalVideoTrack | LocalAudioT
|
|
|
55
56
|
* ```
|
|
56
57
|
* @public
|
|
57
58
|
*/
|
|
58
|
-
export declare function PreJoin({ defaults, onValidate, onSubmit, onError, debug, joinLabel, micLabel, camLabel, userLabel, persistUserChoices, ...htmlProps }: PreJoinProps): JSX.Element;
|
|
59
|
+
export declare function PreJoin({ defaults, onValidate, onSubmit, onError, debug, joinLabel, micLabel, camLabel, userLabel, persistUserChoices, videoProcessor, ...htmlProps }: PreJoinProps): JSX.Element;
|
|
@@ -13,6 +13,12 @@ const ParticipantTileAvatar_1 = tslib_1.__importDefault(require("./ParticipantTi
|
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
const TrackToggle_1 = require("./TrackToggle");
|
|
15
15
|
const LiveStreamProvider_1 = require("./LiveStreamProvider");
|
|
16
|
+
const track_processors_1 = require("@livekit/track-processors");
|
|
17
|
+
const LiveStreamSettingsMenu_1 = tslib_1.__importDefault(require("./LiveStreamSettingsMenu"));
|
|
18
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
19
|
+
const LiveStream_1 = require("../../../constants/LiveStream");
|
|
20
|
+
const react_intl_1 = require("react-intl");
|
|
21
|
+
const notistack_1 = require("notistack");
|
|
16
22
|
/** @alpha */
|
|
17
23
|
function usePreviewTracks(options, onError) {
|
|
18
24
|
const [tracks, setTracks] = React.useState();
|
|
@@ -157,7 +163,8 @@ exports.usePreviewDevice = usePreviewDevice;
|
|
|
157
163
|
* @public
|
|
158
164
|
*/
|
|
159
165
|
function PreJoin(_a) {
|
|
160
|
-
var
|
|
166
|
+
var _b;
|
|
167
|
+
var { defaults = {}, onValidate, onSubmit, onError, debug, joinLabel = 'Join Room', micLabel = 'Microphone', camLabel = 'Camera', userLabel = 'Username', persistUserChoices = true, videoProcessor } = _a, htmlProps = tslib_1.__rest(_a, ["defaults", "onValidate", "onSubmit", "onError", "debug", "joinLabel", "micLabel", "camLabel", "userLabel", "persistUserChoices", "videoProcessor"]);
|
|
161
168
|
const { liveStream } = (0, LiveStreamProvider_1.useLiveStream)();
|
|
162
169
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
163
170
|
const [userChoices, setUserChoices] = React.useState(components_core_2.defaultUserChoices);
|
|
@@ -170,12 +177,16 @@ function PreJoin(_a) {
|
|
|
170
177
|
preventSave: !persistUserChoices,
|
|
171
178
|
preventLoad: !persistUserChoices
|
|
172
179
|
});
|
|
180
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
173
181
|
// Initialize device settings
|
|
174
182
|
const [audioEnabled, setAudioEnabled] = React.useState(initialUserChoices.audioEnabled && canUseAudio);
|
|
175
183
|
const [videoEnabled, setVideoEnabled] = React.useState(initialUserChoices.videoEnabled && canUseVideo);
|
|
176
184
|
const [audioDeviceId, setAudioDeviceId] = React.useState(initialUserChoices.audioDeviceId);
|
|
177
185
|
const [videoDeviceId, setVideoDeviceId] = React.useState(initialUserChoices.videoDeviceId);
|
|
178
186
|
const [username, setUsername] = React.useState(initialUserChoices.username);
|
|
187
|
+
// Processors
|
|
188
|
+
const [blurEnabled, setBlurEnabled] = React.useState((0, utils_1.isClientSideRendering)() ? ((_b = window === null || window === void 0 ? void 0 : window.localStorage) === null || _b === void 0 ? void 0 : _b.getItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT)) === 'true' : false);
|
|
189
|
+
const [processorPending, setProcessorPending] = React.useState(false);
|
|
179
190
|
// Save user choices to persistent storage.
|
|
180
191
|
React.useEffect(() => {
|
|
181
192
|
saveAudioInputEnabled(audioEnabled && canUseAudio);
|
|
@@ -230,6 +241,12 @@ function PreJoin(_a) {
|
|
|
230
241
|
((values.videoEnabled && values.videoDeviceId) || !values.videoEnabled));
|
|
231
242
|
}
|
|
232
243
|
}, [onValidate]);
|
|
244
|
+
const handleBlur = React.useCallback(() => {
|
|
245
|
+
var _a;
|
|
246
|
+
const _blur = !blurEnabled;
|
|
247
|
+
setBlurEnabled(_blur);
|
|
248
|
+
(_a = window === null || window === void 0 ? void 0 : window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT, _blur.toString());
|
|
249
|
+
}, [setBlurEnabled, blurEnabled]);
|
|
233
250
|
(0, react_1.useEffect)(() => {
|
|
234
251
|
const newUserChoices = {
|
|
235
252
|
username,
|
|
@@ -241,6 +258,32 @@ function PreJoin(_a) {
|
|
|
241
258
|
setUserChoices(newUserChoices);
|
|
242
259
|
setIsValid(handleValidation(newUserChoices));
|
|
243
260
|
}, [username, scUserContext.user, videoEnabled, handleValidation, audioEnabled, audioDeviceId, videoDeviceId]);
|
|
261
|
+
(0, react_1.useEffect)(() => {
|
|
262
|
+
var _a;
|
|
263
|
+
if (videoTrack && videoEnabled) {
|
|
264
|
+
setProcessorPending(true);
|
|
265
|
+
try {
|
|
266
|
+
if (blurEnabled && !videoTrack.getProcessor()) {
|
|
267
|
+
videoTrack.setProcessor((0, track_processors_1.BackgroundBlur)(20));
|
|
268
|
+
}
|
|
269
|
+
else if (!blurEnabled) {
|
|
270
|
+
videoTrack.stopProcessor();
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
catch (e) {
|
|
274
|
+
console.log(e);
|
|
275
|
+
setBlurEnabled(false);
|
|
276
|
+
(_a = window === null || window === void 0 ? void 0 : window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT, false.toString());
|
|
277
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.errorApplyVideoEffect", defaultMessage: "ui.contributionActionMenu.errorApplyVideoEffect" }), {
|
|
278
|
+
variant: 'warning',
|
|
279
|
+
autoHideDuration: 3000
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
finally {
|
|
283
|
+
setProcessorPending(false);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}, [blurEnabled, videoTrack, videoEnabled]);
|
|
244
287
|
function handleSubmit(event) {
|
|
245
288
|
event.preventDefault();
|
|
246
289
|
if (handleValidation(userChoices)) {
|
|
@@ -252,6 +295,6 @@ function PreJoin(_a) {
|
|
|
252
295
|
components_core_1.log.warn('Validation failed with: ', userChoices);
|
|
253
296
|
}
|
|
254
297
|
}
|
|
255
|
-
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-prejoin" }, htmlProps, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-container" }, { children: [videoTrack && (0, jsx_runtime_1.jsx)("video", { ref: videoEl, width: "1280", height: "720", "data-lk-facing-mode": facingMode }), (!videoTrack || !videoEnabled) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-camera-off-note" }, { children: (0, jsx_runtime_1.jsx)(ParticipantTileAvatar_1.default, { user: scUserContext.user }) })))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group-container" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group audio" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseAudio, initialState: audioEnabled, source: livekit_client_1.Track.Source.Microphone, onChange: (enabled) => setAudioEnabled(enabled) }, { children: micLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: audioDeviceId, kind: "audioinput", disabled: !audioTrack || !canUseAudio || !audioEnabled, tracks: { audioinput: audioTrack }, onActiveDeviceChange: (_, id) => setAudioDeviceId(id) }) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group video" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseVideo, initialState: videoEnabled, source: livekit_client_1.Track.Source.Camera, onChange: (enabled) => setVideoEnabled(enabled) }, { children: camLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: videoDeviceId, kind: "videoinput", disabled: !videoTrack || !canUseVideo || !videoEnabled, tracks: { videoinput: videoTrack }, onActiveDeviceChange: (_, id) => setVideoDeviceId(id) }) }))] }))] })), (0, jsx_runtime_1.jsx)("form", Object.assign({ className: "lk-username-container" }, { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "lk-button lk-join-button", type: "submit", onClick: handleSubmit, disabled: !isValid || error }, { children: joinLabel })) })), debug && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("strong", { children: "User Choices:" }), (0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: "lk-list", style: { overflow: 'hidden', maxWidth: '15rem' } }, { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Username: ", `${userChoices.username}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Enabled: ", `${userChoices.videoEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Enabled: ", `${userChoices.audioEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Device: ", `${userChoices.videoDeviceId}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Device: ", `${userChoices.audioDeviceId}`] })] }))] }))] })));
|
|
298
|
+
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-prejoin" }, htmlProps, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-container" }, { children: [videoTrack && (0, jsx_runtime_1.jsx)("video", { ref: videoEl, width: "1280", height: "720", "data-lk-facing-mode": facingMode }), (!videoTrack || !videoEnabled) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-camera-off-note" }, { children: (0, jsx_runtime_1.jsx)(ParticipantTileAvatar_1.default, { user: scUserContext.user }) })))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group-container" }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group audio" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseAudio, initialState: audioEnabled, source: livekit_client_1.Track.Source.Microphone, onChange: (enabled) => setAudioEnabled(enabled) }, { children: micLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: audioDeviceId, kind: "audioinput", disabled: !audioTrack || !canUseAudio || !audioEnabled, tracks: { audioinput: audioTrack }, onActiveDeviceChange: (_, id) => setAudioDeviceId(id) }) }))] })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-button-group video" }, { children: [(0, jsx_runtime_1.jsx)(TrackToggle_1.TrackToggle, Object.assign({ disabled: !canUseVideo, initialState: videoEnabled, source: livekit_client_1.Track.Source.Camera, onChange: (enabled) => setVideoEnabled(enabled) }, { children: camLabel })), (0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-button-group-menu" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.MediaDeviceMenu, { initialSelection: videoDeviceId, kind: "videoinput", disabled: !videoTrack || !canUseVideo || !videoEnabled, tracks: { videoinput: videoTrack }, onActiveDeviceChange: (_, id) => setVideoDeviceId(id) }) }))] })), (0, jsx_runtime_1.jsx)(LiveStreamSettingsMenu_1.default, { actionBlurDisabled: !canUseVideo || !videoEnabled, blurEnabled: blurEnabled, handleBlur: handleBlur })] })), (0, jsx_runtime_1.jsx)("form", Object.assign({ className: "lk-username-container" }, { children: (0, jsx_runtime_1.jsx)("button", Object.assign({ className: "lk-button lk-join-button", type: "submit", onClick: handleSubmit, disabled: !isValid || error }, { children: joinLabel })) })), debug && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("strong", { children: "User Choices:" }), (0, jsx_runtime_1.jsxs)("ul", Object.assign({ className: "lk-list", style: { overflow: 'hidden', maxWidth: '15rem' } }, { children: [(0, jsx_runtime_1.jsxs)("li", { children: ["Username: ", `${userChoices.username}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Enabled: ", `${userChoices.videoEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Enabled: ", `${userChoices.audioEnabled}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Video Device: ", `${userChoices.videoDeviceId}`] }), (0, jsx_runtime_1.jsxs)("li", { children: ["Audio Device: ", `${userChoices.audioDeviceId}`] })] }))] }))] })));
|
|
256
299
|
}
|
|
257
300
|
exports.PreJoin = PreJoin;
|
|
@@ -17,6 +17,14 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
17
17
|
const styles_1 = require("@mui/material/styles");
|
|
18
18
|
const material_1 = require("@mui/material");
|
|
19
19
|
const system_1 = require("@mui/system");
|
|
20
|
+
const NoParticipants_1 = tslib_1.__importDefault(require("./NoParticipants"));
|
|
21
|
+
const LiveStreamSettingsMenu_1 = tslib_1.__importDefault(require("./LiveStreamSettingsMenu"));
|
|
22
|
+
const track_processors_1 = require("@livekit/track-processors");
|
|
23
|
+
const utils_1 = require("@selfcommunity/utils");
|
|
24
|
+
const LiveStream_1 = require("../../../constants/LiveStream");
|
|
25
|
+
const Icon_1 = tslib_1.__importDefault(require("@mui/material/Icon"));
|
|
26
|
+
const notistack_1 = require("notistack");
|
|
27
|
+
const react_intl_1 = require("react-intl");
|
|
20
28
|
const PREFIX = 'SCVideoConference';
|
|
21
29
|
const classes = {
|
|
22
30
|
root: `${PREFIX}-root`
|
|
@@ -37,7 +45,7 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
37
45
|
*
|
|
38
46
|
*/
|
|
39
47
|
function VideoConference(inProps) {
|
|
40
|
-
var _a, _b;
|
|
48
|
+
var _a, _b, _c;
|
|
41
49
|
// PROPS
|
|
42
50
|
const props = (0, system_1.useThemeProps)({
|
|
43
51
|
props: inProps,
|
|
@@ -54,15 +62,37 @@ function VideoConference(inProps) {
|
|
|
54
62
|
const lastAutoFocusedScreenShareTrack = React.useRef(null);
|
|
55
63
|
// HOOKS
|
|
56
64
|
const scUserContext = (0, react_core_1.useSCUser)();
|
|
65
|
+
const [blurEnabled, setBlurEnabled] = React.useState((0, utils_1.isClientSideRendering)() ? ((_a = window === null || window === void 0 ? void 0 : window.localStorage) === null || _a === void 0 ? void 0 : _a.getItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT)) === 'true' : false);
|
|
66
|
+
const [processorPending, setProcessorPending] = React.useState(false);
|
|
57
67
|
const tracks = (0, components_react_1.useTracks)([
|
|
58
68
|
{ source: livekit_client_1.Track.Source.Camera, withPlaceholder: true },
|
|
59
69
|
{ source: livekit_client_1.Track.Source.ScreenShare, withPlaceholder: false }
|
|
60
70
|
], { updateOnlyOn: [livekit_client_1.RoomEvent.ActiveSpeakersChanged], onlySubscribed: false });
|
|
71
|
+
const tracksNoParticipants = (0, react_1.useMemo)(() => tracks.filter((t) => t.participant.name === scUserContext.user.username ||
|
|
72
|
+
(speakerFocused && t.participant.name === speakerFocused.username) ||
|
|
73
|
+
t.source === 'screen_share'), [tracks, scUserContext.user]);
|
|
74
|
+
const handleBlur = React.useCallback((event) => {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
if (event.target) {
|
|
77
|
+
if ('checked' in event.target) {
|
|
78
|
+
setBlurEnabled((_a = event.target) === null || _a === void 0 ? void 0 : _a.checked);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
setBlurEnabled((enabled) => !enabled);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
setBlurEnabled((enabled) => !enabled);
|
|
86
|
+
}
|
|
87
|
+
(_b = window === null || window === void 0 ? void 0 : window.localStorage) === null || _b === void 0 ? void 0 : _b.setItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT, (!blurEnabled).toString());
|
|
88
|
+
}, [setBlurEnabled, blurEnabled]);
|
|
61
89
|
const participants = (0, components_react_1.useParticipants)();
|
|
62
90
|
const layoutContext = (0, components_react_1.useCreateLayoutContext)();
|
|
63
91
|
const screenShareTracks = tracks.filter(components_core_1.isTrackReference).filter((track) => track.publication.source === livekit_client_1.Track.Source.ScreenShare);
|
|
64
|
-
const focusTrack = (
|
|
92
|
+
const focusTrack = (_b = (0, components_react_1.usePinnedTracks)(layoutContext)) === null || _b === void 0 ? void 0 : _b[0];
|
|
65
93
|
const carouselTracks = tracks.filter((track) => !(0, components_core_1.isEqualTrackRef)(track, focusTrack));
|
|
94
|
+
const { cameraTrack } = (0, components_react_1.useLocalParticipant)();
|
|
95
|
+
const { enqueueSnackbar } = (0, notistack_1.useSnackbar)();
|
|
66
96
|
(0, useLiveStreamCheck_1.useLivestreamCheck)();
|
|
67
97
|
/**
|
|
68
98
|
* widgetUpdate
|
|
@@ -118,7 +148,7 @@ function VideoConference(inProps) {
|
|
|
118
148
|
}
|
|
119
149
|
}, [
|
|
120
150
|
screenShareTracks.map((ref) => `${ref.publication.trackSid}_${ref.publication.isSubscribed}`).join(),
|
|
121
|
-
(
|
|
151
|
+
(_c = focusTrack === null || focusTrack === void 0 ? void 0 : focusTrack.publication) === null || _c === void 0 ? void 0 : _c.trackSid,
|
|
122
152
|
tracks,
|
|
123
153
|
participants,
|
|
124
154
|
speakerFocused
|
|
@@ -141,11 +171,38 @@ function VideoConference(inProps) {
|
|
|
141
171
|
}
|
|
142
172
|
}
|
|
143
173
|
}, [tracks, participants, speakerFocused]);
|
|
144
|
-
|
|
174
|
+
(0, react_1.useEffect)(() => {
|
|
175
|
+
var _a;
|
|
176
|
+
const localCamTrack = cameraTrack === null || cameraTrack === void 0 ? void 0 : cameraTrack.track;
|
|
177
|
+
if (localCamTrack) {
|
|
178
|
+
setProcessorPending(true);
|
|
179
|
+
try {
|
|
180
|
+
if (blurEnabled && !localCamTrack.getProcessor()) {
|
|
181
|
+
localCamTrack.setProcessor((0, track_processors_1.BackgroundBlur)(20));
|
|
182
|
+
}
|
|
183
|
+
else if (!blurEnabled) {
|
|
184
|
+
localCamTrack.stopProcessor();
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
console.log(e);
|
|
189
|
+
setBlurEnabled(false);
|
|
190
|
+
(_a = window === null || window === void 0 ? void 0 : window.localStorage) === null || _a === void 0 ? void 0 : _a.setItem(LiveStream_1.CHOICE_VIDEO_BLUR_EFFECT, false.toString());
|
|
191
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.liveStreamRoom.errorApplyVideoEffect", defaultMessage: "ui.contributionActionMenu.errorApplyVideoEffect" }), {
|
|
192
|
+
variant: 'warning',
|
|
193
|
+
autoHideDuration: 3000
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
finally {
|
|
197
|
+
setProcessorPending(false);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}, [blurEnabled, cameraTrack]);
|
|
201
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(className, classes.root, 'lk-video-conference') }, rest, { children: [(0, components_core_1.isWeb)() && ((0, jsx_runtime_1.jsxs)(components_react_1.LayoutContextProvider, Object.assign({ value: layoutContext, onPinChange: handleFocusStateChange, onWidgetChange: widgetUpdate }, { children: [(0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-video-conference-inner" }, { children: [!focusTrack ? ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-grid-layout-wrapper" }, { children: (0, jsx_runtime_1.jsx)(components_react_1.GridLayout, Object.assign({ tracks: hideParticipantsList ? tracksNoParticipants : tracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) })) }))) : ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "lk-focus-layout-wrapper" }, { children: hideParticipantsList ? ((0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayoutContainerNoParticipants, { children: focusTrack && (0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayout, { trackRef: focusTrack }) })) : ((0, jsx_runtime_1.jsxs)(FocusLayout_1.FocusLayoutContainer, { children: [carouselTracks.length ? ((0, jsx_runtime_1.jsx)(components_react_1.CarouselLayout, Object.assign({ tracks: carouselTracks }, { children: (0, jsx_runtime_1.jsx)(ParticipantTile_1.ParticipantTile, {}) }))) : ((0, jsx_runtime_1.jsx)(NoParticipants_1.default, {})), focusTrack && (0, jsx_runtime_1.jsx)(FocusLayout_1.FocusLayout, { trackRef: focusTrack })] })) }))), (0, jsx_runtime_1.jsx)(ControlBar_1.ControlBar, { controls: Object.assign({
|
|
145
202
|
chat: !disableChat,
|
|
146
203
|
microphone: !disableMicrophone,
|
|
147
204
|
camera: !disableCamera,
|
|
148
205
|
screenShare: !disableShareScreen
|
|
149
|
-
}, { settings:
|
|
206
|
+
}, { settings: true }) })] })), !disableChat && ((0, jsx_runtime_1.jsx)(components_react_1.Chat, { style: { display: widgetState.showChat ? 'grid' : 'none' }, messageFormatter: chatMessageFormatter, messageEncoder: chatMessageEncoder, messageDecoder: chatMessageDecoder })), (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: "lk-settings-menu-modal", style: { display: widgetState.showSettings ? 'block' : 'none' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ className: "lk-settings-menu-modal-icon-close", onClick: () => { var _a, _b; return (_b = layoutContext === null || layoutContext === void 0 ? void 0 : (_a = layoutContext.widget).dispatch) === null || _b === void 0 ? void 0 : _b.call(_a, { msg: 'toggle_settings' }); } }, { children: (0, jsx_runtime_1.jsx)(Icon_1.default, { children: "close" }) })), SettingsComponent ? ((0, jsx_runtime_1.jsx)(SettingsComponent, {})) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(LiveStreamSettingsMenu_1.default, { onlyContentMenu: true, actionBlurDisabled: !cameraTrack && !disableCamera, blurEnabled: blurEnabled, handleBlur: handleBlur }) }))] }))] }))), (0, jsx_runtime_1.jsx)(components_react_1.RoomAudioRenderer, {}), (0, jsx_runtime_1.jsx)(components_react_1.ConnectionStateToast, {})] })));
|
|
150
207
|
}
|
|
151
208
|
exports.VideoConference = VideoConference;
|
|
@@ -26,7 +26,9 @@ export interface NavigationMenuDrawerProps extends DrawerProps {
|
|
|
26
26
|
* Custom Drawer footer content
|
|
27
27
|
* @default null
|
|
28
28
|
*/
|
|
29
|
-
drawerFooterContent?: React.ReactNode
|
|
29
|
+
drawerFooterContent?: React.ReactNode | ((props: {
|
|
30
|
+
handleCloseMenuDrawer: (event: any, reason: 'backdropClick' | 'escapeKeyDown') => void;
|
|
31
|
+
}) => React.ReactNode);
|
|
30
32
|
/**
|
|
31
33
|
* Props to spread to ScrollContainer component
|
|
32
34
|
* This lib use 'react-custom-scrollbars' component to perform scrollbars
|