From 69b53b4872e5c97d8f072c31a675ddbc22989d51 Mon Sep 17 00:00:00 2001 From: Robert Long <robert@robertlong.me> Date: Fri, 13 Apr 2018 16:44:29 -0700 Subject: [PATCH] Use forEach instead of for loop when stopping streams. --- src/hub.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/hub.js b/src/hub.js index 1c68e22da..af1dcced3 100644 --- a/src/hub.js +++ b/src/hub.js @@ -115,11 +115,7 @@ store.update({ profile: { ...generateDefaultProfile(), ...(store.state.profile | async function exitScene() { if (NAF.connection.adapter && NAF.connection.adapter.localMediaStream) { - const tracks = NAF.connection.adapter.localMediaStream.getTracks(); - - for (const track of tracks) { - track.stop(); - } + NAF.connection.adapter.localMediaStream.getTracks().forEach(t => t.stop()); } const scene = document.querySelector("a-scene"); scene.renderer.animate(null); // Stop animation loop, TODO A-Frame should do this -- GitLab