2024-05-02 03:48:12 +08:00
|
|
|
import React, { useContext } from 'react';
|
|
|
|
import { CameraSettingsDropdownInterface } from 'bigbluebutton-html-plugin-sdk';
|
|
|
|
import { updateSettings } from '/imports/ui/components/settings/service';
|
2024-04-20 04:34:43 +08:00
|
|
|
import { PluginsContext } from '/imports/ui/components/components-data/plugin-context/context';
|
|
|
|
import useUserChangedLocalSettings from '/imports/ui/services/settings/hooks/useUserChangedLocalSettings';
|
|
|
|
import {
|
2024-05-02 03:48:12 +08:00
|
|
|
useDisableReason, useExitVideo, useHasVideoStream, useStatus, useStopVideo,
|
2024-04-20 04:34:43 +08:00
|
|
|
} from '/imports/ui/components/video-provider/video-provider-graphql/hooks';
|
2024-05-02 03:48:12 +08:00
|
|
|
import JoinVideoButton from './component';
|
2024-04-20 04:34:43 +08:00
|
|
|
|
2024-05-02 03:48:12 +08:00
|
|
|
const JoinVideoOptionsContainer: React.FC = () => {
|
2024-04-20 04:34:43 +08:00
|
|
|
const setLocalSettings = useUserChangedLocalSettings();
|
|
|
|
|
|
|
|
const {
|
|
|
|
pluginsExtensibleAreasAggregatedState,
|
|
|
|
} = useContext(PluginsContext);
|
2024-05-02 03:48:12 +08:00
|
|
|
let cameraSettingsDropdownItems: CameraSettingsDropdownInterface[] = [];
|
2024-04-20 04:34:43 +08:00
|
|
|
if (pluginsExtensibleAreasAggregatedState.cameraSettingsDropdownItems) {
|
|
|
|
cameraSettingsDropdownItems = [
|
|
|
|
...pluginsExtensibleAreasAggregatedState.cameraSettingsDropdownItems,
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
const hasVideoStream = useHasVideoStream();
|
|
|
|
const disableReason = useDisableReason();
|
|
|
|
const status = useStatus();
|
2024-05-02 03:48:12 +08:00
|
|
|
const exitVideo = useExitVideo();
|
|
|
|
const stopVideo = useStopVideo();
|
2024-04-20 04:34:43 +08:00
|
|
|
|
|
|
|
return (
|
2024-05-02 03:48:12 +08:00
|
|
|
<JoinVideoButton
|
|
|
|
cameraSettingsDropdownItems={cameraSettingsDropdownItems}
|
|
|
|
hasVideoStream={hasVideoStream}
|
|
|
|
updateSettings={updateSettings}
|
|
|
|
disableReason={disableReason}
|
|
|
|
status={status}
|
|
|
|
setLocalSettings={setLocalSettings}
|
|
|
|
exitVideo={exitVideo}
|
|
|
|
stopVideo={stopVideo}
|
2024-04-20 04:34:43 +08:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-05-02 03:48:12 +08:00
|
|
|
export default JoinVideoOptionsContainer;
|