actually stop the webcam, i.e. all tracks of the media stream when stopping video

pull/89/head
jmoenig 2019-05-07 23:27:18 +02:00
rodzic e63c5e6eb0
commit 33e1b858da
2 zmienionych plików z 4 dodań i 0 usunięć

Wyświetl plik

@ -79,6 +79,7 @@
### 2019-05-07
* Blocks, Objects, Threads, Video: optimized video motion detection
* Objects: actually stop the webcam, i.e. all tracks of the media stream when stopping video
### 2019-05-06
* Blocks, Objects, Threads, Video: New video motion detection feature by Josep Ferràndiz i Farré, under construction

Wyświetl plik

@ -7324,6 +7324,9 @@ StageMorph.prototype.startVideo = function(isFlipped) {
StageMorph.prototype.stopVideo = function() {
if (this.videoElement) {
this.videoElement.stream.getTracks().forEach(
function (track) {track.stop(); }
);
this.videoElement.remove();
this.videoElement = null;
this.videoMotion = null;