Don't break if the call ends before it connects
This commit is contained in:
parent
ee06023573
commit
cc413be446
|
@ -76,12 +76,16 @@ angular.module('MatrixCall', [])
|
||||||
MatrixCall.prototype.hangup = function() {
|
MatrixCall.prototype.hangup = function() {
|
||||||
console.trace("Ending call "+this.call_id);
|
console.trace("Ending call "+this.call_id);
|
||||||
|
|
||||||
forAllTracksOnStream(this.localAVStream, function(t) {
|
if (this.localAVStream) {
|
||||||
t.stop();
|
forAllTracksOnStream(this.localAVStream, function(t) {
|
||||||
});
|
t.stop();
|
||||||
forAllTracksOnStream(this.remoteAVStream, function(t) {
|
});
|
||||||
t.stop();
|
}
|
||||||
});
|
if (this.remoteAVStream) {
|
||||||
|
forAllTracksOnStream(this.remoteAVStream, function(t) {
|
||||||
|
t.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var content = {
|
var content = {
|
||||||
version: 0,
|
version: 0,
|
||||||
|
@ -246,12 +250,16 @@ angular.module('MatrixCall', [])
|
||||||
MatrixCall.prototype.onHangupReceived = function() {
|
MatrixCall.prototype.onHangupReceived = function() {
|
||||||
this.state = 'ended';
|
this.state = 'ended';
|
||||||
|
|
||||||
forAllTracksOnStream(this.localAVStream, function(t) {
|
if (this.localAVStream) {
|
||||||
t.stop();
|
forAllTracksOnStream(this.localAVStream, function(t) {
|
||||||
});
|
t.stop();
|
||||||
forAllTracksOnStream(this.remoteAVStream, function(t) {
|
});
|
||||||
t.stop();
|
}
|
||||||
});
|
if (this.remoteAVStream) {
|
||||||
|
forAllTracksOnStream(this.remoteAVStream, function(t) {
|
||||||
|
t.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
this.onHangup();
|
this.onHangup();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue