kopia lustrzana https://github.com/backface/turtlestitch
stop video stream when webcam dialog is closed
rodzic
075d9c2d3a
commit
a213a1d213
|
@ -8716,6 +8716,7 @@ CamSnapshotDialogMorph.prototype.buildContents = function () {
|
||||||
.then(function (stream) {
|
.then(function (stream) {
|
||||||
myself.videoElement.src = window.URL.createObjectURL(stream);
|
myself.videoElement.src = window.URL.createObjectURL(stream);
|
||||||
myself.videoElement.play();
|
myself.videoElement.play();
|
||||||
|
myself.videoElement.stream = stream;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8799,6 +8800,7 @@ CamSnapshotDialogMorph.prototype.destroy = function () {
|
||||||
|
|
||||||
CamSnapshotDialogMorph.prototype.close = function () {
|
CamSnapshotDialogMorph.prototype.close = function () {
|
||||||
if (this.videoElement) {
|
if (this.videoElement) {
|
||||||
|
this.videoElement.stream.getTracks()[0].stop();
|
||||||
this.videoElement.remove();
|
this.videoElement.remove();
|
||||||
}
|
}
|
||||||
CamSnapshotDialogMorph.uber.destroy.call(this);
|
CamSnapshotDialogMorph.uber.destroy.call(this);
|
||||||
|
|
Ładowanie…
Reference in New Issue