@material-ui/icons#MicOff TypeScript Examples

The following examples show how to use @material-ui/icons#MicOff. 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: useDeviceEnabler.tsx    From flect-chime-sdk-demo with Apache License 2.0 6 votes vote down vote up
DeivceEnableSettings: { [key in DeviceType]: DeviceEnablerSetting } = {
    Microphone: {
        onIcon: <MicOff />,
        offIcon: <Mic />,
        onTooltip: "Mic on",
        offTooltip: "Mute",
    },
    Camera: {
        onIcon: <Videocam />,
        offIcon: <VideocamOff />,
        onTooltip: "Camera off",
        offTooltip: "Camera on",
    },
    Speaker: {
        onIcon: <VolumeUp />,
        offIcon: <VolumeOff />,
        onTooltip: "Speaker off",
        offTooltip: "Speaker on",
    },
}
Example #2
Source File: useAttendeesList.tsx    From flect-chime-sdk-demo with Apache License 2.0 6 votes vote down vote up
AttendeeStateIconSettings: { [key in AttendeeStateIconType]: AttendeeStateIconSetting } = {
    MicOn: {
        icon: <Mic style={{ height: ICON_SIZE, width: ICON_SIZE }} />,
        tooltip: "microphone on",
    },
    MicOff: {
        icon: <MicOff style={{ height: ICON_SIZE, width: ICON_SIZE }} />,
        tooltip: "microphone off",
    },
    CameraOn: {
        icon: <Videocam style={{ height: ICON_SIZE, width: ICON_SIZE }} />,
        tooltip: "camera on",
    },
    CameraOff: {
        icon: <VideocamOff style={{ height: ICON_SIZE, width: ICON_SIZE }} />,
        tooltip: "camera off",
    },
    CameraPaused: {
        icon: <VideocamOff style={{ height: ICON_SIZE, width: ICON_SIZE }} />,
        tooltip: "camera paused",
        color: "#ee7777",
    },
}
Example #3
Source File: useAttendeesList.tsx    From flect-chime-sdk-demo with Apache License 2.0 5 votes vote down vote up
AttendeeStateIconType = {
    MicOn: "MicOn",
    MicOff: "MicOff",
    CameraOn: "CameraOn",
    CameraOff: "CameraOff",
    CameraPaused: "CameraPaused",
} as const
Example #4
Source File: useAttendeesList.tsx    From flect-chime-sdk-demo with Apache License 2.0 5 votes vote down vote up
useAttendeesList = () => {
    const { chimeClientState } = useAppState();
    chimeClientState.attendees;

    const attendeesKey = Object.values(chimeClientState.attendees).reduce((prev, cur) => {
        return `${prev}_${cur.attendeeId}[m:${cur.muted},c:${cur.attendeeId === chimeClientState.attendeeId ? chimeClientState.videoInputEnable : cur.cameraOn},p:${cur.isVideoPaused}]`;
    }, "");

    const generateButton = (setting: AttendeeStateIconSetting, onClick?: () => void) => {
        return (
            <Tooltip title={setting.tooltip}>
                <IconButton color="inherit" style={{ paddingTop: "1px", paddingBottom: "1px", paddingLeft: "1px", paddingRight: "1px", color: setting.color ? setting.color : "#000000" }} onClick={onClick}>
                    {setting.icon}
                </IconButton>
            </Tooltip>
        );
    };
    const generateNamePlate = (name: string) => {
        let attendeeName = name;
        if (name.length > 10) {
            attendeeName = name.substr(0, 8) + "...";
        }
        return <Tooltip title={name}>{<div style={{ fontSize: FONT_SIZE }}>{attendeeName}</div>}</Tooltip>;
    };
    const attendeeList = useMemo(() => {
        const attendeeRows = Object.values(chimeClientState.attendees).map((x) => {
            const micIcon = x.muted ? generateButton(AttendeeStateIconSettings.MicOff) : generateButton(AttendeeStateIconSettings.MicOn);
            let cameraIcon;
            let isCameraOn;
            if (x.attendeeId === chimeClientState.attendeeId) {
                isCameraOn = chimeClientState.videoInputEnable;
            } else {
                isCameraOn = x.cameraOn;
            }
            if (isCameraOn === true && x.isVideoPaused === true) {
                cameraIcon = generateButton(AttendeeStateIconSettings.CameraPaused, () => {
                    chimeClientState.pauseVideo(x.attendeeId, false);
                    console.log("unpause!", x.attendeeId);
                });
            } else if (isCameraOn === true && x.isVideoPaused === false) {
                cameraIcon = generateButton(AttendeeStateIconSettings.CameraOn, () => {
                    chimeClientState.pauseVideo(x.attendeeId, true);
                    console.log("pause!", x.attendeeId);
                });
            } else {
                cameraIcon = generateButton(AttendeeStateIconSettings.CameraOff);
            }
            const namePlate = generateNamePlate(x.name);
            return (
                <div key={x.attendeeId} style={{ display: "flex", alignItems: "center" }}>
                    {micIcon}
                    {cameraIcon}
                    {namePlate}
                </div>
            );
        });
        return <div style={{ display: "flex", flexDirection: "column", background: "#ffffffaa", overflow: "auto" }}>{attendeeRows}</div>;
    }, [attendeesKey]);

    return { attendeeList };
}