From 33bc9c866205ed48f346366a3384e0bc0b052fd3 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Thu, 30 May 2024 11:04:30 +0200 Subject: [PATCH] Explicitly stop processors before re-applying in sample --- example/sample.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/example/sample.ts b/example/sample.ts index 20e690f..7bb2b86 100644 --- a/example/sample.ts +++ b/example/sample.ts @@ -247,6 +247,7 @@ const appActions = { const camTrack = currentRoom.localParticipant.getTrackPublication(Track.Source.Camera)! .track as LocalVideoTrack; if (camTrack.getProcessor()?.name !== 'background-blur') { + await camTrack.stopProcessor(); await camTrack.setProcessor(state.blur); } else { await camTrack.stopProcessor(); @@ -267,6 +268,7 @@ const appActions = { const camTrack = currentRoom.localParticipant.getTrackPublication(Track.Source.Camera)! .track as LocalVideoTrack; if (camTrack.getProcessor()?.name !== 'virtual-background') { + await camTrack.stopProcessor(); await camTrack.setProcessor(state.virtualBackground); } else { await camTrack.stopProcessor(); @@ -288,6 +290,7 @@ const appActions = { .track as LocalVideoTrack; await state.virtualBackground.updateTransformerOptions({ imagePath }); if (camTrack.getProcessor()?.name !== 'virtual-background') { + await camTrack.stopProcessor(); await camTrack.setProcessor(state.virtualBackground); } } catch (e: any) {