Skip to content

Switching the webcam shows an error in the JavaScript console #6

@osteele

Description

@osteele

Switching to another Webcam produces the following error:

Uncaught (in promise) Error: The video element has not loaded data yet. Please wait for `loadeddata` event on the <video> element.
    at fromPixels_ (browser.ts:115:13)
    at Object.fromPixels__op (operation.ts:51:22)
    at rt (pose-detection.esm.js:17:8462)
    at pose-detection.esm.js:17:29554
    at engine.ts:467:20
    at Engine.scopedRun (engine.ts:478:19)
    at Engine.tidy (engine.ts:465:17)
    at tidy (globals.ts:192:17)
    at t2.<anonymous> (pose-detection.esm.js:17:29531)
    at pose-detection.esm.js:17:2276
fromPixels_ @ browser.ts:115

As a developer, this is an annoyance if you have the console open.

The fix would be to stop the BlazePose detector (by detector.dispose()?), and stop the loop, when the webcam is shut down, and to call initializeBlazePose() again to start another detector that starts when new video data arrives.

This would probably be simpler if initializeBlazePose() were replaced by an OO interface so that additional methods could be added in a modular way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions