2020-12-10 06:00:54 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
|
|
import ScreenshareButton from './component';
|
2022-02-07 21:22:52 +08:00
|
|
|
import { isScreenSharingEnabled } from '/imports/ui/services/features';
|
2020-12-10 06:00:54 +08:00
|
|
|
import {
|
2023-03-28 05:40:08 +08:00
|
|
|
isScreenBroadcasting,
|
2020-12-10 06:00:54 +08:00
|
|
|
dataSavingSetting,
|
2024-05-24 22:44:36 +08:00
|
|
|
useIsSharing,
|
|
|
|
useSharingContentType,
|
2020-12-10 06:00:54 +08:00
|
|
|
} from '/imports/ui/components/screenshare/service';
|
|
|
|
|
2021-08-09 22:24:02 +08:00
|
|
|
const ScreenshareButtonContainer = (props) => <ScreenshareButton {...props} />;
|
2020-12-10 06:00:54 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* All props, including the ones that are inherited from actions-bar
|
2023-03-28 05:40:08 +08:00
|
|
|
* isScreenBroadcasting,
|
2020-12-10 06:00:54 +08:00
|
|
|
* amIPresenter,
|
|
|
|
* screenSharingCheck,
|
|
|
|
* isMeteorConnected,
|
|
|
|
* screenshareDataSavingSetting,
|
|
|
|
*/
|
2024-05-24 22:44:36 +08:00
|
|
|
const ScreenshareButtonContainerTracker = withTracker(({ isSharing, sharingContentType }) => ({
|
|
|
|
isScreenBroadcasting: isScreenBroadcasting(isSharing, sharingContentType),
|
2020-12-10 06:00:54 +08:00
|
|
|
screenshareDataSavingSetting: dataSavingSetting(),
|
2022-02-07 21:22:52 +08:00
|
|
|
enabled: isScreenSharingEnabled(),
|
2023-03-27 23:36:25 +08:00
|
|
|
}))(ScreenshareButtonContainer);
|
2024-05-24 22:44:36 +08:00
|
|
|
|
|
|
|
// TODO: Remove this
|
|
|
|
// Temporary component until we remove all trackers
|
|
|
|
export default (props) => {
|
|
|
|
const isSharing = useIsSharing();
|
|
|
|
const sharingContentType = useSharingContentType();
|
|
|
|
return (
|
|
|
|
<ScreenshareButtonContainerTracker
|
|
|
|
{...{
|
|
|
|
...props,
|
|
|
|
isSharing,
|
|
|
|
sharingContentType,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|