aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/webcam/DashWebRTC.ts
diff options
context:
space:
mode:
authorMohammad Amoush <muhammedamoush@gmail.com>2019-12-07 16:57:51 -0500
committerMohammad Amoush <muhammedamoush@gmail.com>2019-12-07 16:57:51 -0500
commit01c131e8d7ecc2eac68e16a679c40b1156b41391 (patch)
tree6b35ba68c75979170bc4a14e8147157b8a7140ca /src/client/views/webcam/DashWebRTC.ts
parent40c40d377ec169b44e1a9691129e5c7a6b0b10e4 (diff)
Adding hang-up functionality
Diffstat (limited to 'src/client/views/webcam/DashWebRTC.ts')
-rw-r--r--src/client/views/webcam/DashWebRTC.ts11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/views/webcam/DashWebRTC.ts b/src/client/views/webcam/DashWebRTC.ts
index c61469cb8..195f1f0c4 100644
--- a/src/client/views/webcam/DashWebRTC.ts
+++ b/src/client/views/webcam/DashWebRTC.ts
@@ -283,10 +283,15 @@ export namespace DashWebRTC {
console.log('Remote stream removed. Event: ', event);
}
- function hangup() {
+ export function hangup() {
console.log('Hanging up.');
- stop();
- sendMessage('bye');
+ if (pc) {
+ stop();
+ sendMessage('bye');
+ }
+ //stop local tracks on hang-up
+ //localVideo.srcObject!.getTracks().forEach(track => track.stop());
+
}
function handleRemoteHangup() {