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

31 lines
1.0 KiB
React
Raw Normal View History

2018-11-07 07:10:56 +08:00
import React from 'react';
2022-02-15 23:54:55 +08:00
import { withModalMounter } from '/imports/ui/components/common/modal/service';
2018-11-07 07:10:56 +08:00
import { withTracker } from 'meteor/react-meteor-data';
import Service from './service';
import VideoPreview from './component';
2019-11-28 21:13:06 +08:00
import VideoService from '../video-provider/service';
const VideoPreviewContainer = (props) => <VideoPreview {...props} />;
export default withModalMounter(withTracker(({ mountModal }) => ({
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
},
stopSharing: (deviceId) => {
mountModal(null);
2020-03-12 03:42:53 +08:00
if (deviceId) {
const streamId = VideoService.getMyStreamId(deviceId);
if (streamId) VideoService.stopVideo(streamId);
2020-03-12 03:42:53 +08:00
} else {
VideoService.exitVideo();
}
},
sharedDevices: VideoService.getSharedDevices(),
isCamLocked: VideoService.isUserLocked(),
camCapReached: VideoService.hasCapReached(),
closeModal: () => mountModal(null),
webcamDeviceId: Service.webcamDeviceId(),
2020-03-12 03:42:53 +08:00
hasVideoStream: VideoService.hasVideoStream(),
2018-11-07 07:10:56 +08:00
}))(VideoPreviewContainer));