stop video stream when webcam dialog is closed

upd4.1
Bernat Romagosa 2017-06-12 12:36:26 +02:00
rodzic 075d9c2d3a
commit a213a1d213
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -8716,6 +8716,7 @@ CamSnapshotDialogMorph.prototype.buildContents = function () {
.then(function (stream) {
myself.videoElement.src = window.URL.createObjectURL(stream);
myself.videoElement.play();
myself.videoElement.stream = stream;
});
}
@ -8799,6 +8800,7 @@ CamSnapshotDialogMorph.prototype.destroy = function () {
CamSnapshotDialogMorph.prototype.close = function () {
if (this.videoElement) {
this.videoElement.stream.getTracks()[0].stop();
this.videoElement.remove();
}
CamSnapshotDialogMorph.uber.destroy.call(this);