mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-07-14 11:06:36 +00:00
FSRTC - calling localStream.stop when it's available or localStream.active = false to make it work on newer chrome canary
This commit is contained in:
parent
5a5793ce99
commit
5d2ef7dac4
@ -313,7 +313,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self.localStream) {
|
if (self.localStream) {
|
||||||
|
if(typeof self.localStream.stop == 'function') {
|
||||||
self.localStream.stop();
|
self.localStream.stop();
|
||||||
|
} else {
|
||||||
|
self.localStream.active = false;
|
||||||
|
}
|
||||||
self.localStream = null;
|
self.localStream = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,7 +331,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (self.options.localVideoStream) {
|
if (self.options.localVideoStream) {
|
||||||
|
if(typeof self.options.localVideoStream.stop == 'function') {
|
||||||
self.options.localVideoStream.stop();
|
self.options.localVideoStream.stop();
|
||||||
|
} else {
|
||||||
|
self.options.localVideoStream.active = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.peer) {
|
if (self.peer) {
|
||||||
@ -951,7 +959,11 @@
|
|||||||
stop: function() {
|
stop: function() {
|
||||||
peer.close();
|
peer.close();
|
||||||
if (options.attachStream) {
|
if (options.attachStream) {
|
||||||
|
if(typeof options.attachStream.stop == 'function') {
|
||||||
options.attachStream.stop();
|
options.attachStream.stop();
|
||||||
|
} else {
|
||||||
|
options.attachStream.active = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1073,7 +1085,13 @@
|
|||||||
audio: ttl++ == 0,
|
audio: ttl++ == 0,
|
||||||
video: video
|
video: video
|
||||||
},
|
},
|
||||||
onsuccess: function(e) {e.stop(); console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);},
|
onsuccess: function(e) {
|
||||||
|
if(typeof e.stop == 'function') {
|
||||||
|
e.stop();
|
||||||
|
} else {
|
||||||
|
e.active = false;
|
||||||
|
}
|
||||||
|
console.info(w + "x" + h + " supported."); $.FSRTC.validRes.push([w, h]); checkRes(cam, func);},
|
||||||
onerror: function(e) {console.error( w + "x" + h + " not supported."); checkRes(cam, func);}
|
onerror: function(e) {console.error( w + "x" + h + " not supported."); checkRes(cam, func);}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1108,7 +1126,17 @@
|
|||||||
audio: check_audio,
|
audio: check_audio,
|
||||||
video: check_video,
|
video: check_video,
|
||||||
},
|
},
|
||||||
onsuccess: function(e) {e.stop(); console.info("media perm init complete"); if (runtime) {setTimeout(runtime, 100, true)}},
|
onsuccess: function(e) {
|
||||||
|
if(typeof e.stop == 'function') {
|
||||||
|
e.stop();
|
||||||
|
} else {
|
||||||
|
e.active = false;
|
||||||
|
}
|
||||||
|
console.info("media perm init complete");
|
||||||
|
if (runtime) {
|
||||||
|
setTimeout(runtime, 100, true);
|
||||||
|
}
|
||||||
|
},
|
||||||
onerror: function(e) {
|
onerror: function(e) {
|
||||||
if (check_video && check_audio) {
|
if (check_video && check_audio) {
|
||||||
console.error("error, retesting with audio params only");
|
console.error("error, retesting with audio params only");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user