03cd3af26c
Mainly: track unhealthy fatal states instead of supposedly healthy states Avoids unwarranted UI reconnecting states or flickering on low end devices or struggling networks Also added a version of isVideoBroadcasting for presenters which only accounts for the server state, so that we can deal with the presnter`s sharing state with more fidelity in the UI
29 lines
898 B
JavaScript
Executable File
29 lines
898 B
JavaScript
Executable File
import React from 'react';
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
import Users from '/imports/api/users/';
|
|
import Auth from '/imports/ui/services/auth';
|
|
import MediaService, { getSwapLayout, shouldEnableSwapLayout } from '/imports/ui/components/media/service';
|
|
import {
|
|
isVideoBroadcasting,
|
|
isGloballyBroadcasting,
|
|
} from './service';
|
|
import ScreenshareComponent from './component';
|
|
|
|
const ScreenshareContainer = (props) => {
|
|
if (isVideoBroadcasting()) {
|
|
return <ScreenshareComponent {...props} />;
|
|
}
|
|
return null;
|
|
};
|
|
|
|
export default withTracker(() => {
|
|
const user = Users.findOne({ userId: Auth.userID }, { fields: { presenter: 1 } });
|
|
return {
|
|
isGloballyBroadcasting: isGloballyBroadcasting(),
|
|
isPresenter: user.presenter,
|
|
getSwapLayout,
|
|
shouldEnableSwapLayout,
|
|
toggleSwapLayout: MediaService.toggleSwapLayout,
|
|
};
|
|
})(ScreenshareContainer);
|