Update when reject
This commit is contained in:
parent
67afec48c1
commit
3feb6c3f22
10
src/App.js
10
src/App.js
@ -89,7 +89,7 @@ class App extends Component {
|
||||
origin_asset_type_name: this.state.user.user_role.name,
|
||||
origin_asset_name: this.state.user.name,
|
||||
video_call_id: parseDate.video_call_id,
|
||||
answer: 'YES'
|
||||
answer: 'accepted' // answer: 'rejected'
|
||||
}));
|
||||
}
|
||||
|
||||
@ -101,6 +101,12 @@ class App extends Component {
|
||||
|
||||
// Handler for 'notify-answer'
|
||||
if(parseDate.type === 'notify-answer') {
|
||||
|
||||
if(parseDate.answer === 'rejected') {
|
||||
this.closeVideo()
|
||||
return
|
||||
}
|
||||
|
||||
// Create media stream
|
||||
navigator.mediaDevices.getUserMedia(streamConstraints).then(stream => {
|
||||
console.log('Created getUserMedia', stream);
|
||||
@ -245,7 +251,7 @@ class App extends Component {
|
||||
}
|
||||
|
||||
cleanVideoStreams = () => {
|
||||
this.state.rtcPeerConnection.close();
|
||||
this.state.rtcPeerConnection != null && this.state.rtcPeerConnection.close();
|
||||
this.setState({ callId: null, rtcPeerConnection: null });
|
||||
localVideo.srcObject = null;
|
||||
remoteVideo.srcObject = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user