2018-02-17 03:18:53 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2018-02-17 03:18:53 +08:00
|
|
|
import VideoProvider from './component';
|
2018-02-19 12:23:05 +08:00
|
|
|
import VideoService from './service';
|
2018-02-17 03:18:53 +08:00
|
|
|
|
2018-12-18 06:19:26 +08:00
|
|
|
const VideoProviderContainer = ({ children, ...props }) => {
|
|
|
|
const { users } = props;
|
|
|
|
return (!users.length ? null : <VideoProvider {...props}>{children}</VideoProvider>);
|
|
|
|
};
|
2018-02-17 03:18:53 +08:00
|
|
|
|
2018-03-20 01:52:39 +08:00
|
|
|
export default withTracker(() => ({
|
|
|
|
meetingId: VideoService.meetingId(),
|
2018-04-12 02:50:14 +08:00
|
|
|
users: VideoService.getAllUsersVideo(),
|
2018-03-20 01:52:39 +08:00
|
|
|
userId: VideoService.userId(),
|
2018-07-10 05:29:27 +08:00
|
|
|
sessionToken: VideoService.sessionToken(),
|
2018-06-20 01:36:12 +08:00
|
|
|
userName: VideoService.userName(),
|
2018-09-14 02:09:30 +08:00
|
|
|
enableVideoStats: getFromUserSettings('enableVideoStats', Meteor.settings.public.kurento.enableVideoStats),
|
2018-08-27 15:37:25 +08:00
|
|
|
voiceBridge: VideoService.voiceBridge(),
|
2018-03-20 01:52:39 +08:00
|
|
|
}))(VideoProviderContainer);
|