Display video call labels.
This commit is contained in:
+11
-5
@@ -2605,20 +2605,26 @@ video {
|
|||||||
width:100%;
|
width:100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#video-container-panel {
|
.video-container-panel {
|
||||||
-ms-flex-align: center!important;
|
-ms-flex-align: center!important;
|
||||||
align-items: center!important;
|
align-items: center!important;
|
||||||
margin-top: 10%;
|
margin-top: 10%;
|
||||||
|
position:relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.local-video {
|
.video-elem {
|
||||||
width:50%;
|
width:50%;
|
||||||
float:left;
|
float:left;
|
||||||
|
position:relative;
|
||||||
|
z-index:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.remote-video {
|
.video-title {
|
||||||
width:50%;
|
position:absolute;
|
||||||
float:left;
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 1;
|
||||||
|
background-color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
#video-container-controls {
|
#video-container-controls {
|
||||||
|
|||||||
@@ -1736,14 +1736,8 @@ class TinodeWeb extends React.Component {
|
|||||||
this.handleCallClose();
|
this.handleCallClose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (!extend) {
|
|
||||||
this.handleCallClose();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
let until = new Date(this.state.callLeaseExpires); //this.state.callLeaseExpires.getSeconds() + 10;
|
let until = new Date(this.state.callLeaseExpires);
|
||||||
until.setSeconds(until.getSeconds() + 10);
|
until.setSeconds(until.getSeconds() + 10);
|
||||||
topic.call('extend-lease', this.state.callSeq, undefined, until)
|
topic.call('extend-lease', this.state.callSeq, undefined, until)
|
||||||
.then((ctrl) => {
|
.then((ctrl) => {
|
||||||
@@ -1756,20 +1750,12 @@ class TinodeWeb extends React.Component {
|
|||||||
let head = {mime: 'application/tinode-video-call'};
|
let head = {mime: 'application/tinode-video-call'};
|
||||||
this.handleSendMessage('started', undefined, undefined, head)
|
this.handleSendMessage('started', undefined, undefined, head)
|
||||||
.then((ctrl) => {
|
.then((ctrl) => {
|
||||||
//this.handleTeleLeaseReply(ctrl, 0);
|
|
||||||
if (ctrl.code < 200 || ctrl.code >= 300 || typeof ctrl.params == 'undefined' || typeof ctrl.params['seq'] == 'undefined') {
|
if (ctrl.code < 200 || ctrl.code >= 300 || typeof ctrl.params == 'undefined' || typeof ctrl.params['seq'] == 'undefined') {
|
||||||
this.handleCallClose();
|
this.handleCallClose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.setState({callSeq: ctrl.params['seq']});
|
this.setState({callSeq: ctrl.params['seq']});
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
topic.call('invite').then((ctrl) => {
|
|
||||||
if (ctrl.params && ctrl.params['sip-code'] == 100) {
|
|
||||||
this.handleTeleLeaseReply(ctrl, 0);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
} else if (callState == 3) {
|
} else if (callState == 3) {
|
||||||
const topic = this.tinode.getTopic(callTopic);
|
const topic = this.tinode.getTopic(callTopic);
|
||||||
if (!topic) {
|
if (!topic) {
|
||||||
|
|||||||
@@ -218,6 +218,8 @@ export default class RtcPanel extends React.PureComponent {
|
|||||||
|
|
||||||
handleTrackEvent(event) {
|
handleTrackEvent(event) {
|
||||||
this.remoteRef.current.srcObject = event.streams[0];
|
this.remoteRef.current.srcObject = event.streams[0];
|
||||||
|
// Make sure we redraw the UI properly.
|
||||||
|
this.forceUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
handleGetUserMediaError(e) {
|
handleGetUserMediaError(e) {
|
||||||
@@ -276,7 +278,6 @@ export default class RtcPanel extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stopTracks(el) {
|
stopTracks(el) {
|
||||||
//let lr = this.localRef.current;
|
|
||||||
if (el == null) { return; }
|
if (el == null) { return; }
|
||||||
let stream = el.srcObject;
|
let stream = el.srcObject;
|
||||||
if (stream == null) { return; }
|
if (stream == null) { return; }
|
||||||
@@ -343,6 +344,8 @@ export default class RtcPanel extends React.PureComponent {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const remoteActive = this.remoteRef.current != null && this.remoteRef.current.srcObject != null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div id="topic-caption-panel" className="caption-panel">
|
<div id="topic-caption-panel" className="caption-panel">
|
||||||
@@ -368,12 +371,17 @@ export default class RtcPanel extends React.PureComponent {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="video-container">
|
<div id="video-container">
|
||||||
<div id="video-container-panel">
|
<div className="video-container-panel">
|
||||||
<div className="local-video">
|
<div className="video-elem">
|
||||||
<video id="localVideo" ref={this.localRef} autoPlay muted playsInline></video>
|
<video id="localVideo" ref={this.localRef} autoPlay muted playsInline></video>
|
||||||
|
<div className="video-title">You</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="remote-video">
|
<div className="video-elem">
|
||||||
<video id="remoteVideo" ref={this.remoteRef} autoPlay playsInline></video>
|
<video id="remoteVideo" ref={this.remoteRef} autoPlay playsInline></video>
|
||||||
|
{remoteActive ?
|
||||||
|
<div className="video-title">{this.props.title}</div>
|
||||||
|
:
|
||||||
|
null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="video-container-controls">
|
<div id="video-container-controls">
|
||||||
|
|||||||
Reference in New Issue
Block a user