Skip to content

Commit

Permalink
Fix video ui for p2p calls
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-nadymov committed Apr 12, 2021
1 parent 8fab4f6 commit d994186
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "https://evgeny-nadymov.github.io/telegram-react",
"name": "telegram_react",
"version": "0.0.989",
"version": "0.0.990",
"private": true,
"dependencies": {
"tdweb": "^1.7.2",
Expand Down
1 change: 1 addition & 0 deletions src/Components/Calls/CallPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
position: absolute;
left: 0;
right: 0;
z-index: 1;
}

.call-panel-microphone-hint-wrapper {
Expand Down
7 changes: 4 additions & 3 deletions src/Components/Calls/GroupCallPanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#call-output-video {
width: 348px;
max-height: 320px;
height: 348px;
background: black;
}

.full-screen #call-output-video {
Expand Down Expand Up @@ -115,11 +116,11 @@

.group-call-panel-buttons {
flex-shrink: 0;
padding: 58px 40px;
padding: 30px 40px 58px 40px;
display: flex;
flex-direction: row;
justify-content: space-between;
height: 220px;
height: 192px;
min-width: 348px;
box-sizing: border-box;
position: relative;
Expand Down
10 changes: 9 additions & 1 deletion src/Stores/CallStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -1971,6 +1971,11 @@ class CallStore extends EventEmitter {
}
}

// if (description.type === 'offer' && description.sdp.indexOf('a=setup:active')) {
// description.sdp = description.sdp.replaceAll('a=setup:active', 'a=setup:actpass')
// }

console.log('[sdp] remote', description.type, description.sdp)
await connection.setRemoteDescription(description);

if (currentCall.candidates) {
Expand All @@ -1982,7 +1987,10 @@ class CallStore extends EventEmitter {

if (!isAnswer) {
const answer = await connection.createAnswer();
console.log('[sdp] local', answer.sdp);
// if (description.sdp.indexOf('a=setup:active') && answer.sdp.indexOf('a=setup:active')) {
// answer.sdp = answer.sdp.replaceAll('a=setup:active', 'a=setup:passive');
// }
console.log('[sdp] local', answer.type, answer.sdp);
await connection.setLocalDescription(answer);

// LOG_P2P_CALL('2 try invoke p2pAppendInputStream', inputStream, is_outgoing);
Expand Down

0 comments on commit d994186

Please sign in to comment.