Skip to content

Commit 6a60951

Browse files
Martin Veilletteclaude
authored andcommitted
fix: reset tracking when switching video sources
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3b0a0cd commit 6a60951

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/screen-name/model/SimModel.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export class SimModel {
7676

7777
/** Activate a webcam recording as the current video source. */
7878
public activateRecording(recording: WebcamRecording): void {
79+
this.tracking.reset();
7980
this.sources.isUserVideoProperty.value = true;
8081
this.playback.frameRateProperty.value = recording.fps;
8182
this.playback.totalFrameCountProperty.value = 0;
@@ -84,6 +85,7 @@ export class SimModel {
8485

8586
/** Activate an uploaded video as the current video source. */
8687
public activateUpload(upload: UploadedVideo): void {
88+
this.tracking.reset();
8789
this.sources.isUserVideoProperty.value = true;
8890
this.playback.frameRateProperty.value = upload.fps;
8991
this.playback.totalFrameCountProperty.value = upload.frameCount ?? 0;
@@ -92,6 +94,7 @@ export class SimModel {
9294

9395
/** Activate a bundled (sample) video as the current video source. */
9496
public activateBundledVideo(frameCount: number, fps: number): void {
97+
this.tracking.reset();
9598
this.sources.isUserVideoProperty.value = false;
9699
this.sources.currentWebcamBlobProperty.value = null;
97100
this.playback.totalFrameCountProperty.value = frameCount;

0 commit comments

Comments
 (0)