2021-06-17 00:05:42 +08:00
|
|
|
import React, { useContext } from 'react';
|
2018-11-30 01:24:02 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2019-02-28 03:59:45 +08:00
|
|
|
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';
|
2021-08-10 03:06:31 +08:00
|
|
|
import MediaService, { getSwapLayout } from '/imports/ui/components/media/service';
|
2018-11-30 01:24:02 +08:00
|
|
|
|
2021-06-17 00:05:42 +08:00
|
|
|
const ExternalVideoContainer = (props) => {
|
2021-08-05 19:03:24 +08:00
|
|
|
const layoutManager = useContext(LayoutContext);
|
2021-08-10 03:06:31 +08:00
|
|
|
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;
|
2021-08-10 03:06:31 +08:00
|
|
|
return (
|
|
|
|
<ExternalVideoComponent
|
|
|
|
{
|
|
|
|
...{
|
|
|
|
layoutContextDispatch,
|
|
|
|
...props,
|
|
|
|
...externalVideo,
|
2021-08-13 21:47:19 +08:00
|
|
|
isResizing,
|
2021-08-10 03:06:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
);
|
2021-06-17 00:05:42 +08:00
|
|
|
};
|
2018-11-30 01:24:02 +08:00
|
|
|
|
2019-10-11 05:01:27 +08:00
|
|
|
export default withTracker(({ isPresenter }) => {
|
2019-02-28 03:59:45 +08:00
|
|
|
const inEchoTest = Session.get('inEchoTest');
|
2018-11-30 01:24:02 +08:00
|
|
|
return {
|
2019-02-28 03:59:45 +08:00
|
|
|
inEchoTest,
|
2019-02-19 20:14:29 +08:00
|
|
|
isPresenter,
|
2019-09-11 02:04:42 +08:00
|
|
|
videoUrl: getVideoUrl(),
|
2021-08-10 03:06:31 +08:00
|
|
|
getSwapLayout,
|
|
|
|
toggleSwapLayout: MediaService.toggleSwapLayout,
|
2018-11-30 01:24:02 +08:00
|
|
|
};
|
2019-10-08 01:45:16 +08:00
|
|
|
})(ExternalVideoContainer);
|