bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/external-video-player/container.jsx
2021-08-13 10:51:32 -03:00

40 lines
1.1 KiB
JavaScript

import React, { useContext } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { Session } from 'meteor/session';
import { getVideoUrl } from './service';
import ExternalVideoComponent from './component';
import LayoutContext from '../layout/context';
import MediaService, { getSwapLayout } from '/imports/ui/components/media/service';
const ExternalVideoContainer = (props) => {
const layoutManager = useContext(LayoutContext);
const { layoutContextState, layoutContextDispatch } = layoutManager;
const { output, input } = layoutContextState;
const { externalVideo } = output;
const { cameraDock } = input;
const { isResizing } = cameraDock;
return (
<ExternalVideoComponent
{
...{
layoutContextDispatch,
...props,
...externalVideo,
isResizing,
}
}
/>
);
};
export default withTracker(({ isPresenter }) => {
const inEchoTest = Session.get('inEchoTest');
return {
inEchoTest,
isPresenter,
videoUrl: getVideoUrl(),
getSwapLayout,
toggleSwapLayout: MediaService.toggleSwapLayout,
};
})(ExternalVideoContainer);