l1npengtul / nokhwa

Cross Platform Rust Library for Powerful Webcam/Camera Capture
Apache License 2.0
482 stars 111 forks source link

[Web] Update `jscam` example to function correctly in the latest version #168

Open k2m5t2 opened 4 months ago

k2m5t2 commented 4 months ago

Hi, I see that there have been breaking changes in v0.10.0 for web/wasm support.

You can still use nokhwa in the browser, you just can't use it from JS. (0.10.0 release notes)

Currently, the jscam example does not compile, and I am lost on how to configure and test using nokhwa in a browser, since there are some backend-specific code involved (i.e., do I detect platform and invoke the right backend and decoding in the runtime? how do I setup the build and feature activation in cargo.toml?)

I would like to see the examples to be in line with the current API.

I am willing to work to create a PR (likely with some help), but still created this issue so we can track progress.