@material-ui/icons#ScreenShare TypeScript Examples
The following examples show how to use
@material-ui/icons#ScreenShare.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: useFeatureEnabler.tsx From flect-chime-sdk-demo with Apache License 2.0 | 6 votes |
FeatureEnablerSettings: { [key in FeatureType]: FeatureEnablerSetting } = {
ScreenShare: {
onIcon: <ScreenShare style={{ color: "#ee7777" }} />,
offIcon: <ScreenShare />,
onTooltip: "Stop ScreenShare",
offTooltip: "Start ScreenShare",
},
SideBar: {
onIcon: <Receipt style={{ color: "#ee7777" }} />,
offIcon: <Receipt />,
onTooltip: "close sidebar",
offTooltip: "open sidebar",
},
AttendeesView: {
onIcon: <PeopleIcon style={{ color: "#ee7777" }} />,
offIcon: <PeopleIcon />,
onTooltip: "close attendees view",
offTooltip: "show attendees view",
},
Transcribe: {
onIcon: <Title style={{ color: "#ee7777" }} />,
offIcon: <Title />,
onTooltip: "stop transcribe",
offTooltip: "start transcribe",
},
}
Example #2
Source File: useFeatureEnabler.tsx From flect-chime-sdk-demo with Apache License 2.0 | 5 votes |
FeatureType = {
ScreenShare: "ScreenShare",
SideBar: "SideBar",
AttendeesView: "AttendeesView",
Transcribe: "Transcribe",
} as const
Example #3
Source File: useFeatureEnabler.tsx From flect-chime-sdk-demo with Apache License 2.0 | 5 votes |
useFeatureEnabler = () => {
const { chimeClientState, frontendState } = useAppState();
const enableShareContet = async (val: boolean) => {
console.log("enable share", val);
if (val) {
try {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore https://github.com/microsoft/TypeScript/issues/31821
const media = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: true,
});
chimeClientState.startShareContent(media);
} catch (e) {
console.log(e);
}
} else {
chimeClientState.stopShareContent();
}
};
const generateButton = (setting: FeatureEnablerSetting, setEnable: (val: boolean) => void, enable: boolean) => {
return (
<Tooltip title={enable ? setting.onTooltip : setting.offTooltip}>
<IconButton
style={{ height: ToolbarHeight, width: ToolbarHeight }}
color="inherit"
onClick={() => {
setEnable(!enable);
}}
>
{enable ? setting.onIcon : setting.offIcon}
</IconButton>
</Tooltip>
);
};
const screenShareButton = useMemo(() => {
return generateButton(FeatureEnablerSettings.ScreenShare, enableShareContet, chimeClientState.isShareContent);
}, [chimeClientState.isShareContent]);
const sideBarButton = useMemo(() => {
return generateButton(FeatureEnablerSettings.SideBar, frontendState.setSideBarOpen, frontendState.sideBarOpen);
}, [frontendState.sideBarOpen]);
const attendeesViewButton = useMemo(() => {
return generateButton(FeatureEnablerSettings.AttendeesView, frontendState.setAttendeesViewOpen, frontendState.attendeesViewOpen);
}, [frontendState.attendeesViewOpen]);
const transcribeButton = useMemo(() => {
return generateButton(FeatureEnablerSettings.Transcribe, chimeClientState.setTranscribeEnable, chimeClientState.transcribeEnable);
}, [chimeClientState.transcribeEnable]);
return { screenShareButton, sideBarButton, attendeesViewButton, transcribeButton };
}