diff options
author | Mohammad Amoush <47069173+mamoush34@users.noreply.github.com> | 2020-02-06 18:20:43 -0500 |
---|---|---|
committer | Mohammad Amoush <47069173+mamoush34@users.noreply.github.com> | 2020-02-06 18:20:43 -0500 |
commit | 9ed82143d9e7c439dc494abfc8825c81b1eabbbf (patch) | |
tree | 322c0858f1ad2280d8f4eb8d2dfd4015a4cbc9d3 | |
parent | 09da787bb56157ce6ec08f5e835249f8907ef13d (diff) |
HangUp bug fixed
-rw-r--r-- | src/client/views/webcam/DashWebRTCVideo.tsx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/views/webcam/DashWebRTCVideo.tsx b/src/client/views/webcam/DashWebRTCVideo.tsx index acba95354..56894c0ac 100644 --- a/src/client/views/webcam/DashWebRTCVideo.tsx +++ b/src/client/views/webcam/DashWebRTCVideo.tsx @@ -131,7 +131,7 @@ export class DashWebRTCVideo extends React.Component<CollectionFreeFormDocumentV candidate: message.message.candidate }); self.pc.addIceCandidate(candidate); - } else if (message === 'bye' && self.isStarted) { + } else if (message.message === 'bye' && self.isStarted) { self.handleRemoteHangup(); } }); @@ -335,8 +335,14 @@ export class DashWebRTCVideo extends React.Component<CollectionFreeFormDocumentV private handleRemoteHangup = () => { console.log('Session terminated.'); - stop(); + this.stop(); this.isInitiator = false; + + if (this.localStream) { + this.localStream.getTracks().forEach(track => track.stop()); + } + + } private stop = () => { |