bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/external-video-player/container.jsx

40 lines
1.1 KiB
React
Raw Normal View History

2021-06-17 00:05:42 +08:00
import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { Session } from 'meteor/session';
2019-09-11 02:04:42 +08:00
import { getVideoUrl } from './service';
2021-06-17 00:05:42 +08:00
import ExternalVideoComponent from './component';
2021-08-05 19:03:24 +08:00
import LayoutContext from '../layout/context';
import MediaService, { getSwapLayout } from '/imports/ui/components/media/service';
2021-06-17 00:05:42 +08:00
const ExternalVideoContainer = (props) => {
2021-08-05 19:03:24 +08:00
const layoutManager = useContext(LayoutContext);
const { layoutContextState, layoutContextDispatch } = layoutManager;
2021-08-13 21:47:19 +08:00
const { output, input } = layoutContextState;
2021-06-17 00:05:42 +08:00
const { externalVideo } = output;
2021-08-13 21:47:19 +08:00
const { cameraDock } = input;
const { isResizing } = cameraDock;
return (
<ExternalVideoComponent
{
...{
layoutContextDispatch,
...props,
...externalVideo,
2021-08-13 21:47:19 +08:00
isResizing,
}
}
/>
);
2021-06-17 00:05:42 +08:00
};
export default withTracker(({ isPresenter }) => {
const inEchoTest = Session.get('inEchoTest');
return {
inEchoTest,
isPresenter,
2019-09-11 02:04:42 +08:00
videoUrl: getVideoUrl(),
getSwapLayout,
toggleSwapLayout: MediaService.toggleSwapLayout,
};
})(ExternalVideoContainer);