Skip to content

Commit e0c2a60

Browse files
author
evgeny-nadymov
committed
Full screen for P2P calls
1 parent 754045a commit e0c2a60

File tree

3 files changed

+39
-12
lines changed

3 files changed

+39
-12
lines changed

src/Components/Calls/CallPanel.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ class CallPanel extends React.Component {
9999
};
100100

101101
handleClose = () => {
102-
closeGroupCallPanel();
102+
const { callId } = this.props;
103+
104+
CallStore.p2pDiscardCall(callId, false, 0, false, 0);
103105
};
104106

105107
handleShareScreen = () => {
@@ -236,8 +238,8 @@ class CallPanel extends React.Component {
236238
rippleVisible : 'group-call-participant-menu-item-ripple-visible'
237239
}
238240
}}
239-
onClick={this.handleShareScreen}>
240-
<ListItemText primary={screenSharing ? t('StopScreenSharing') : t('StartScreenSharing')} />
241+
onClick={this.handleFullScreen}>
242+
<ListItemText primary={fullScreen ? t('ExitFullScreen') : t('EnterFullScreen')} />
241243
</MenuItem>
242244
<MenuItem
243245
classes={{ root: 'group-call-participant-menu-item' }}
@@ -248,8 +250,8 @@ class CallPanel extends React.Component {
248250
rippleVisible : 'group-call-participant-menu-item-ripple-visible'
249251
}
250252
}}
251-
onClick={this.handleFullScreen}>
252-
<ListItemText primary={fullScreen ? t('ExitFullScreen') : t('EnterFullScreen')} />
253+
onClick={this.handleShareScreen}>
254+
<ListItemText primary={screenSharing ? t('StopScreenSharing') : t('StartScreenSharing')} />
253255
</MenuItem>
254256
</MenuList>
255257
</Popover>

src/Components/Calls/GroupCallPanel.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
max-height: 320px;
1111
}
1212

13+
.full-screen #call-output-video {
14+
max-width: unset;
15+
max-height: unset;
16+
width: 100%;
17+
height: 100%;
18+
}
19+
1320
#call-input-video {
1421
transform: scaleX(-1);
1522
max-width: 100px;
@@ -20,7 +27,14 @@
2027
top: 0;
2128
}
2229

30+
.full-screen #call-input-video {
31+
max-width: 200px;
32+
max-height: 200px;
33+
margin: 0 16px;
34+
}
35+
2336
.group-call-panel {
37+
overflow: hidden;
2438
width: 380px;
2539
height: 600px;
2640
border-radius: 12px;
@@ -74,6 +88,11 @@
7488
position: relative;
7589
}
7690

91+
.full-screen .call-panel-content {
92+
margin: 0;
93+
border-radius: 0;
94+
}
95+
7796
.call-panel-content {
7897
flex: 1 1 auto;
7998
overflow-y: hidden;
@@ -93,8 +112,10 @@
93112
flex-direction: row;
94113
justify-content: space-between;
95114
height: 220px;
115+
min-width: 320px;
96116
box-sizing: border-box;
97117
position: relative;
118+
align-self: center;
98119
}
99120

100121
.group-call-panel-button-leave {
@@ -129,4 +150,8 @@
129150
font-size: 11px;
130151
line-height: normal;
131152
text-align: center;
153+
}
154+
155+
.full-screen .group-call-settings {
156+
border-radius: 0;
132157
}

src/Components/MainPage.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,13 @@ class MainPage extends React.Component {
224224
{isChatDetailsVisible && <ChatInfo />}
225225
</div>
226226
<Actions/>
227-
{instantViewContent && <InstantViewer {...instantViewContent} />}
228-
{mediaViewerContent && <MediaViewer {...mediaViewerContent} />}
229-
{profileMediaViewerContent && <ProfileMediaViewer {...profileMediaViewerContent} />}
230-
{forwardInfo && <ForwardDialog {...forwardInfo} />}
231-
{videoInfo && <PipPlayer {...videoInfo}/>}
232-
{groupCallId && <GroupCall groupCallId={groupCallId}/>}
233-
{callId && <Call callId={callId}/>}
227+
{Boolean(instantViewContent) && <InstantViewer {...instantViewContent} />}
228+
{Boolean(mediaViewerContent) && <MediaViewer {...mediaViewerContent} />}
229+
{Boolean(profileMediaViewerContent) && <ProfileMediaViewer {...profileMediaViewerContent} />}
230+
{Boolean(forwardInfo) && <ForwardDialog {...forwardInfo} />}
231+
{Boolean(videoInfo) && <PipPlayer {...videoInfo}/>}
232+
{Boolean(groupCallId) && <GroupCall groupCallId={groupCallId}/>}
233+
{Boolean(callId) && <Call callId={callId}/>}
234234
</>
235235
);
236236
}

0 commit comments

Comments
 (0)