2018-11-07 07:10:56 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2019-06-28 00:02:42 +08:00
|
|
|
import deviceInfo from '/imports/utils/deviceInfo';
|
2018-11-07 07:10:56 +08:00
|
|
|
import Service from './service';
|
|
|
|
import VideoPreview from './component';
|
2019-11-28 21:13:06 +08:00
|
|
|
import VideoService from '../video-provider/service';
|
2019-11-06 04:23:13 +08:00
|
|
|
|
2018-11-07 07:10:56 +08:00
|
|
|
const VideoPreviewContainer = props => <VideoPreview {...props} />;
|
|
|
|
|
2019-11-22 01:18:42 +08:00
|
|
|
export default withModalMounter(withTracker(({ mountModal, fromInterface }) => ({
|
2019-11-28 00:19:09 +08:00
|
|
|
startSharing: deviceId => {
|
2018-11-07 07:10:56 +08:00
|
|
|
mountModal(null);
|
2019-11-28 00:19:09 +08:00
|
|
|
VideoService.joinVideo(deviceId);
|
2018-11-07 07:10:56 +08:00
|
|
|
},
|
2019-11-29 04:28:41 +08:00
|
|
|
stopSharing: deviceId => {
|
|
|
|
mountModal(null);
|
2019-12-19 01:44:56 +08:00
|
|
|
const stream = VideoService.getMyStream(deviceId);
|
|
|
|
if (stream) VideoService.stopVideo(stream);
|
2019-11-29 04:28:41 +08:00
|
|
|
},
|
|
|
|
sharedDevices: VideoService.getSharedDevices(),
|
2019-06-28 00:02:42 +08:00
|
|
|
closeModal: () => mountModal(null),
|
2018-11-07 07:10:56 +08:00
|
|
|
changeWebcam: deviceId => Service.changeWebcam(deviceId),
|
2018-11-17 02:56:39 +08:00
|
|
|
webcamDeviceId: Service.webcamDeviceId(),
|
2019-04-09 06:07:26 +08:00
|
|
|
changeProfile: profileId => Service.changeProfile(profileId),
|
2019-06-28 00:02:42 +08:00
|
|
|
hasMediaDevices: deviceInfo.hasMediaDevices,
|
2019-12-19 01:44:56 +08:00
|
|
|
skipVideoPreview: VideoService.getSkipVideoPreview(fromInterface),
|
2018-11-07 07:10:56 +08:00
|
|
|
}))(VideoPreviewContainer));
|