bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/screenshare/container.jsx
prlanzarin 03cd3af26c screenshare: change the reconnection UI style trigger to avoid false positives
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
2021-02-05 19:54:12 -03:00

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);