bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/breakout-room/container.jsx

60 lines
1.7 KiB
React
Raw Normal View History

2021-05-18 04:25:07 +08:00
import React, { useContext } from 'react';
2018-10-24 01:18:09 +08:00
import { withTracker } from 'meteor/react-meteor-data';
import AudioService from '/imports/ui/components/audio/service';
import AudioManager from '/imports/ui/services/audio-manager';
2018-10-24 01:18:09 +08:00
import BreakoutComponent from './component';
import Service from './service';
2021-08-05 19:03:24 +08:00
import LayoutContext from '../layout/context';
2018-10-24 01:18:09 +08:00
2021-05-18 04:25:07 +08:00
const BreakoutContainer = (props) => {
2021-08-05 19:03:24 +08:00
const layoutContext = useContext(LayoutContext);
const { layoutContextDispatch } = layoutContext;
return <BreakoutComponent {...{ layoutContextDispatch, ...props }} />;
2021-05-18 04:25:07 +08:00
};
2018-10-24 01:18:09 +08:00
export default withTracker((props) => {
const {
endAllBreakouts,
requestJoinURL,
extendBreakoutsTime,
isExtendTimeHigherThanMeetingRemaining,
findBreakouts,
getBreakoutRoomUrl,
2018-10-24 01:18:09 +08:00
transferUserToMeeting,
transferToBreakout,
meetingId,
amIModerator,
isUserInBreakoutRoom,
2018-10-24 01:18:09 +08:00
} = Service;
const breakoutRooms = findBreakouts();
2018-10-24 01:18:09 +08:00
const isMicrophoneUser = AudioService.isConnected() && !AudioService.isListenOnly();
2019-06-27 00:29:34 +08:00
const isMeteorConnected = Meteor.status().connected;
const isReconnecting = AudioService.isReconnecting();
const {
setBreakoutAudioTransferStatus,
getBreakoutAudioTransferStatus,
} = AudioService;
2018-10-24 01:18:09 +08:00
return {
...props,
breakoutRooms,
endAllBreakouts,
requestJoinURL,
extendBreakoutsTime,
isExtendTimeHigherThanMeetingRemaining,
getBreakoutRoomUrl,
2018-10-24 01:18:09 +08:00
transferUserToMeeting,
transferToBreakout,
isMicrophoneUser,
meetingId: meetingId(),
amIModerator: amIModerator(),
2019-06-27 00:29:34 +08:00
isMeteorConnected,
isUserInBreakoutRoom,
exitAudio: () => AudioManager.exitAudio(),
isReconnecting,
setBreakoutAudioTransferStatus,
getBreakoutAudioTransferStatus,
2018-10-24 01:18:09 +08:00
};
})(BreakoutContainer);