aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/webcam/DashWebRTCVideo.tsx10
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 = () => {