2018-02-17 03:18:53 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
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 }) => {
|
2019-11-28 21:13:06 +08:00
|
|
|
const { streams } = props;
|
|
|
|
return (!streams.length ? null : <VideoProvider {...props}>{children}</VideoProvider>);
|
2018-12-18 06:19:26 +08:00
|
|
|
};
|
2018-02-17 03:18:53 +08:00
|
|
|
|
2019-08-10 06:28:49 +08:00
|
|
|
export default withTracker(props => ({
|
|
|
|
swapLayout: props.swapLayout,
|
2019-11-28 21:13:06 +08:00
|
|
|
streams: VideoService.getVideoStreams(),
|
|
|
|
isUserLocked: VideoService.isUserLocked(),
|
2019-08-10 06:28:49 +08:00
|
|
|
}))(VideoProviderContainer);
|