Skip to content

Commit e64d034

Browse files
hyrumcoopgruhn
authored andcommitted
fix: application freezes when stream is paused or stopped
1 parent f131c2c commit e64d034

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/misc/camera.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ class Camera {
1010
}
1111

1212
stop() {
13-
this.stream.getTracks().forEach(track => track.stop());
13+
this.videoEl.srcObject = null;
14+
15+
this.stream.getTracks().forEach(track => {
16+
this.stream.removeTrack(track);
17+
track.stop();
18+
});
1419
}
1520

1621
captureFrame() {

0 commit comments

Comments
 (0)