2020-04-13 18:15:00 +10:00
|
|
|
import React from "react";
|
|
|
|
|
import { Box, Text, Button, Label, Flex } from "theme-ui";
|
|
|
|
|
|
|
|
|
|
import Modal from "../components/Modal";
|
|
|
|
|
|
|
|
|
|
function StartStreamModal({
|
|
|
|
|
isOpen,
|
|
|
|
|
onRequestClose,
|
|
|
|
|
isSupported,
|
|
|
|
|
unavailableMessage,
|
|
|
|
|
stream,
|
|
|
|
|
noAudioTrack,
|
|
|
|
|
noAudioMessage,
|
|
|
|
|
onStreamStart,
|
|
|
|
|
onStreamEnd,
|
|
|
|
|
}) {
|
|
|
|
|
return (
|
|
|
|
|
<Modal isOpen={isOpen} onRequestClose={onRequestClose}>
|
|
|
|
|
<Box>
|
|
|
|
|
<Label pt={2} pb={1}>
|
2020-10-17 16:17:38 +11:00
|
|
|
Audio Sharing (experimental)
|
2020-04-13 18:15:00 +10:00
|
|
|
</Label>
|
|
|
|
|
<Text as="p" mb={2} variant="caption">
|
|
|
|
|
Share your computers audio with the party
|
|
|
|
|
</Text>
|
|
|
|
|
{!isSupported && unavailableMessage}
|
|
|
|
|
{isSupported && !stream && noAudioTrack && noAudioMessage}
|
|
|
|
|
<Flex py={2}>
|
|
|
|
|
{isSupported && !stream && (
|
|
|
|
|
<Button sx={{ flexGrow: 1 }} onClick={onStreamStart}>
|
2020-10-17 16:17:38 +11:00
|
|
|
Start Sharing
|
2020-04-13 18:15:00 +10:00
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
{isSupported && stream && (
|
|
|
|
|
<Button sx={{ flexGrow: 1 }} onClick={() => onStreamEnd(stream)}>
|
2020-10-17 16:17:38 +11:00
|
|
|
Stop Sharing
|
2020-04-13 18:15:00 +10:00
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
</Flex>
|
|
|
|
|
</Box>
|
|
|
|
|
</Modal>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default StartStreamModal;
|