diff --git a/demo_cam_reader.html b/demo_cam_reader.html
index e04f5f3..e42d3aa 100644
--- a/demo_cam_reader.html
+++ b/demo_cam_reader.html
@@ -134,6 +134,7 @@
zxing-cpp/wasm live demo
navigator.mediaDevices
.getUserMedia({ video: { facingMode: deviceId }, audio: false })
.then(function (stream) {
+ stream.getTracks().forEach(track => track.stop());
video.srcObject = stream;
video.setAttribute("playsinline", true); // required to tell iOS safari we don't want fullscreen
video.play();