|
@@ -115,6 +115,8 @@
|
|
|
|
|
|
otSessionId: '',
|
|
|
|
|
|
+ publisher: false,
|
|
|
+
|
|
|
checkingForNextPatient: false,
|
|
|
noNextPatient: false,
|
|
|
|
|
@@ -199,8 +201,10 @@
|
|
|
return minutes + " min, " + seconds + " sec";
|
|
|
},
|
|
|
hangUp: function () {
|
|
|
+ var self = this;
|
|
|
if (this.otSession) {
|
|
|
try {
|
|
|
+ this.otSession.unpublish(this.publisher);
|
|
|
this.otSession.disconnect();
|
|
|
} catch (e) {
|
|
|
console.log('Was already disconnected.');
|
|
@@ -210,6 +214,10 @@
|
|
|
this.started = false;
|
|
|
this.startTime = false;
|
|
|
this.videoActive = false;
|
|
|
+ if(self.publisher){
|
|
|
+ self.publisher.destroy();
|
|
|
+ }
|
|
|
+ window.top.hideRHS();
|
|
|
// this.client = false;
|
|
|
}
|
|
|
},
|
|
@@ -370,7 +378,7 @@
|
|
|
height: '100%',
|
|
|
};
|
|
|
var publisher = OT.initPublisher('self-view', publisherOptions, self.handleOpenTokError);
|
|
|
-
|
|
|
+
|
|
|
publisher.on('streamCreated', function (event) {
|
|
|
var selfView = $('#self-view');
|
|
|
selfView.attr('data-stream', event.stream.id);
|
|
@@ -427,7 +435,7 @@
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
-
|
|
|
+ self.publisher = publisher;
|
|
|
|
|
|
// Connect to the session
|
|
|
self.otSession.connect(token, function callback(error) {
|