bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-provider/container.jsx
2023-05-11 17:20:26 -03:00

32 lines
986 B
JavaScript
Executable File

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import VideoProvider from './component';
import VideoService from './service';
const VideoProviderContainer = ({ children, ...props }) => {
const { streams, isGridEnabled } = props;
return (!streams.length && !isGridEnabled ? null : <VideoProvider {...props}>{children}</VideoProvider>);
};
export default withTracker(({ swapLayout, ...rest }) => {
// getVideoStreams returns a dictionary consisting of:
// {
// streams: array of mapped streams
// totalNumberOfStreams: total number of shared streams in the server
// }
const {
streams,
totalNumberOfStreams,
} = VideoService.getVideoStreams();
return {
swapLayout,
streams,
totalNumberOfStreams,
isUserLocked: VideoService.isUserLocked(),
currentVideoPageIndex: VideoService.getCurrentVideoPageIndex(),
isMeteorConnected: Meteor.status().connected,
...rest,
};
})(VideoProviderContainer);