Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 54 additions & 29 deletions src/ui/components/video/VideoChatComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function VideoChatComponent(props) {
const [openEnd, setOpenEnd] = useState(false);
const [buttonDis, setButtonDis] = useState(false);
const [buttonDisStop, setButtonDisStop] = useState(true);
const [startSession, setStartSession] = useState(false);

const recommendedTime = 10 * 60;
const [countDown, setCountDown] = useState(recommendedTime); // 10 minutes
Expand Down Expand Up @@ -239,14 +240,17 @@ function VideoChatComponent(props) {
setIsAudioEnabled(action);
toggleAudio(action);
};

const onToggleVideo = action => {
setIsVideoEnabled(action);
toggleVideo(action);
};

const onToggleAudioSubscription = action => {
setIsAudioSubscribed(action);
toggleAudioSubscription(action);
};

const onToggleVideoSubscription = action => {
setIsVideoSubscribed(action);
toggleVideoSubscription(action);
Expand Down Expand Up @@ -445,6 +449,7 @@ function VideoChatComponent(props) {
</Fab>
</Tooltip>
)}

{isVideoSubscribed ? (
<Tooltip title="screen on">
<Fab size="medium" style={{ marginBottom: 10, marginRight: 10, backgroundColor: '#565656' }}>
Expand All @@ -470,21 +475,27 @@ function VideoChatComponent(props) {
)}
</div>
)}
<Fab
aria-describedby={'addPin'}
aria-label="addPin"
type="button"
color="default"
className="pin-Btn"
onClick={() => {
handlePinButtonClick();
}}
ref={pinBtn}
>
<Icon classes={{ root: classes.iconRoot }}>
<img className={classes.imageIcon} src={pin} alt="" />
</Icon>
</Fab>

{startSession ? (
<Fab
aria-describedby={'addPin'}
aria-label="addPin"
type="button"
color="default"
className="pin-Btn"
onClick={() => {
handlePinButtonClick();
}}
ref={pinBtn}
>
<Icon classes={{ root: classes.iconRoot }}>
<img className={classes.imageIcon} src={pin} alt="" />
</Icon>
</Fab>
) : (
<div> </div>
)}

<Popper open={popperOpen} anchorEl={pinBtn.current} placement="right" style={{ zIndex: 3 }} transition>
<ColorLibPaper elevation={2}>
<Typography variant="body2">{getPopperContent(popperContentIndex)}</Typography>
Expand All @@ -494,7 +505,12 @@ function VideoChatComponent(props) {
);
};

const scrollToWebcam = () => {
window.scrollTo(0, 175);
};

const handleStartChat = async (setApiKey, setSessionId, setToken, baseURL) => {
scrollToWebcam();
setOpen(false);
console.log('loading info now...');
setLoadingStatus(true);
Expand Down Expand Up @@ -527,6 +543,9 @@ function VideoChatComponent(props) {
if (!isVideoEnabled) {
onToggleVideo(false);
}
if (!startSession) {
setStartSession(true);
}
if (props.isArchiveHost) {
//props.startRec();
//console.log("start recording");
Expand Down Expand Up @@ -798,6 +817,16 @@ function VideoChatComponent(props) {
</div>

<div className="actions-btns">
<Button
id="start-Btn"
onClick={() => handleStartArchive()}
color="secondary"
variant="contained"
disable={buttonDis}
>
Start Button
</Button>

<ColorLibCallEndButton
variant="contained"
size="medium"
Expand All @@ -806,20 +835,16 @@ function VideoChatComponent(props) {
>
Begin Discussion Prep
</ColorLibCallEndButton>
{/* {props.isArchiveHost ? (
<Button onClick={() => handleStartArchive()} color="secondary" variant="contained" disabled={buttonDis}>
Start Recording
</Button>
) : (
<div></div>
)}
{props.isArchiveHost ? (
<Button onClick={() => handleStopArchive()} color="secondary" variant="contained" disabled={buttonDisStop}>
Stop Recording
</Button>
) : (
<div></div>
)} */}

<Button
id="stop-Btn"
onClick={() => handleStopArchive()}
color="secondary"
variant="contained"
disabled={buttonDisStop}
>
Stop Button
</Button>
</div>
</>
);
Expand Down
10 changes: 8 additions & 2 deletions src/ui/components/video/VideoChatComponent.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
.actions-btns {
display: flex;
justify-content: center;
margin-top: -15px;
z-index: 4;
padding: 20px 0;
.MuiButtonBase-root {
margin: 0 20px;
}
}

.mini-video-container {
position: fixed;
height: 25vh;
Expand Down Expand Up @@ -70,8 +73,11 @@

.video-container {
position: relative;
height: 100vh;
width: 100%;
height: 85vh;
width: 90%;
margin-left: auto;
margin-right: auto;
z-index: 0;
.main-video {
position: relative;
width: 100%;
Expand Down