Stop tracks before closing stream.
Otherwise the camera status light stays on.
This commit is contained in:
@@ -54,6 +54,12 @@ Connection.prototype.close = function(sendit) {
|
||||
while(this.timers.length > 0)
|
||||
clearInterval(this.timers.pop());
|
||||
|
||||
this.stream.getTracks().forEach(t => {
|
||||
try {
|
||||
t.stop();
|
||||
} catch(e) {
|
||||
}
|
||||
});
|
||||
this.pc.close();
|
||||
|
||||
if(sendit) {
|
||||
|
||||
Reference in New Issue
Block a user